Forums | Mahara Community

Support /
Date Display broken


anonymous profile picture
Account deleted
Posts: 52

05 August 2010, 8:35

Good morning, or whatever time of day it is where you are!

Our Mahara installation (ver. 1.2.5, running on Apache 2.2/PHP 5.3/MySQL on a Windows server) is not displaying any date data. At first, php-errors.log was showing a...

[WAR] 2c (E:\www\iNetwork\lib\mahara.php:1257) strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.

...error, so I added a date.timezone setting in PHP's INI file per this blurb on PHP's site. That error went away, but another...

[WAR] 8e (E:\www\iNetwork\lib\mahara.php:1257) Invalid CRT parameters detected

...remains (it was there before also), and dates are still not displayed. I noticed this thread in this forum, and so made the change in the .../lang/en.utf8/langconfig.php file per Iñaki Arenaza's contribution ($string['strftimedate'] = '%%d %%B %%Y';). But the errors remain, and dates still will not display.

Any ideas?

Iñaki Arenaza's profile picture
Posts: 253

09 August 2010, 10:46

Hi Jeffrey,

could you add a temporary logging sentence to that part of the code so we can find the offending format string? (it'll probably be 'strftimedatetime', but just in case)

You just need to add a single line to function format_date() to log the formatkey value on each call. Add this line:

log_debug('$formatkey value is |' . $formatkey . '|');

before the line that reads:

return strftime(get_string($formatkey), $date);

Once you get the 'Invalid CRT parameters detected' warning in your logs, you can remove the new line. Just above the 'Invalid CRT...' warning line in your PHP error logs, you'll have another line that shows the value of formatkey variable. That should help us track where we are going wrong :-)

Saludos.
Iñaki.

Thomas Edwards's profile picture
Posts: 9

19 October 2010, 8:25

I couldn't find a straight forward 'how to' for fixing this so... Just for information. I came across the same issue and fixed it by editing:

mahararoot\lang\en.utf8\langconfig.php

I then changed all 'e' to 'd' and all 'l' (lowercase L) to 'I' (uppercase i)

Thank you Inaki for pointing me in the right direction.

Hope this helps someone.

anonymous profile picture
Account deleted
Posts: 52

09 November 2010, 8:39

Thomas:
       I did make the changes you suggested below, but it cured only some of the date display problems. Forum postings still do not include date/time stamps.

Iñaki:
       I'm just now getting back to this. Since I posted above, we've upgraded to 1.3.2, but my hoped-for fix for date display did not happen with it. I'm not sure exactly where you want me to stick your code addtion. Here's the latest error I pulled out of my PHP log, edited to remove local directory info.

[09-Nov-2010 09:07:46]   * strftime("%d %B %Y, %i:%M %p", "1285350823") at E:[maharadirectory]\lib\mahara.php:1387
[09-Nov-2010 09:07:46]   * format_date("1285350823") at E:\maharadata\dwoo\compile\fresh\E-\www\inetwork\blocktype\wall\theme\raw\inlineposts.tpl.d17.php:36

I'm not sure that's what would be useful for this...

 

anonymous profile picture
Account deleted
Posts: 52

10 November 2010, 11:28

I'm sorry...I missed "Upper case i" and when I changed all of the i's to upper case, all the dates came back.

I notice this is being tracked as a bug ("Some time/date settings in langconfig.php are not compatible with Windows")...hope there's a code fix for this going into the next version, though I'm content with the mod I'm doin' to make my install happy.

anonymous profile picture
Account deleted
Posts: 34

16 November 2011, 9:50

Thomas - this helped me with the journal entries not showing their date/time of posting, they now do so thanks for sharing your solution!

But forum posts still aren't showing any date/time indication like the ones on this forum do. Any ideas where this is set or why it's not appearing?

Thanks,
Dave

anonymous profile picture
Account deleted
Posts: 34

13 December 2011, 4:21

Thomas - I figured out where was going wrong.

I did the find/replace as per your post, BUT this also changed the lowercase L of strftimerecentfull to strftimerecentfuII (so the capital i's broke the array reference) - I'm guessing the Journal and Forum codes use different $string inserts. But just correcting strftimerecentfull back to lowercase Ls at the end fixed it. Just in time for a couple of demos of it this week!

A post by Account deleted was deleted

8 results