I've been holding off on updating Date because I'm on PHP 5.1.x for the foreseeable future, and got the WSOD starting with 2.5. I updated our testbed site to 2.7 this morning:

Date fields display incorrectly in both Views and on individual nodes. All date fields display as today in whatever format they normally show. (Jan 4, 1/04/2011, etc)

Dates appear to be stored correctly: when I go in to edit, I see the right date, and Views logic is selecting correctly (ie: dates after today, dates less than 2 weeks from now, etc)

I've tried using the -dev version. I've tried clearing all the caches, including Views' cache. I've run update.php multiple times, and checked to make sure that the right version info is being stored. I've edited the date fields and Views.

I reverted to 2.4 and everything went back to normal.

Comments

kawandabe’s picture

I confirm the problem running:
Drupal core 6.2
Content Construction Kit (CCK) 6.x-2.8
Views 6.x-2.12
Genesis 6.x-2.4
(Date, Date API, Date PHP4, Date Timezone are actif)

Tried the 6.x-2.7 normal and dev and dates are stored correctly but viewed as todays date.
Downgraded to Date 6.x-2.4 and everything ok.

jdnik22’s picture

same problem here since i updated the date module.

Date is stored as choosen (i.e. birthday) but shown as the current date (i.e. today 5th jan) in my views.

Another problem occures with the date module by using the calender in views.

terrychild’s picture

I get the same running RHEL 5.5 with PHP 5.1.6 (its default).

I had a look in the Apache error log (I don't know if this is releated):

PHP Fatal error: Call to undefined function timezone_name_from_abbr() in /var/www/drupal-6.20-dev/sites/all/modules/date/date_timezone/date_timezone.module on line 269

HooPee’s picture

Version: 6.x-2.x-dev » 6.x-2.7
Priority: Critical » Normal

I have drupal 6.18 with PHP 5.2.6 and MySQL 5.1.49. I haven't had any problems before with this great module but after updating date module from 2.5 to 2.7 my Locale settings in Date and Time section is not saved. I believe this is something similar that terrychild (post #3) saw from Apache error log.

HooPee’s picture

Version: 6.x-2.7 » 6.x-2.x-dev
Priority: Normal » Critical

sorry for changing info...

terrychild’s picture

Version: 6.x-2.x-dev » 6.x-2.7
Priority: Critical » Normal

This looks like a PHP version issue.

I just upgraded my RHEL 5.5 server to PHP 5.3.4 using the IUS repository and the dates are displaying correctly.

See - http://wiki.iuscommunity.org/Doc/ClientUsageGuide

terrychild’s picture

Version: 6.x-2.7 » 6.x-2.x-dev
Priority: Normal » Critical

Looks like I was replying while HooPee was correcting his Info change.

Changing back to original status (Critical Dev).

Tecktron’s picture

I too have this issue, subscribing.

php 5.1 (server admin won't upgrade system until the RPM update is available directly from Redhat? SOL on 5.2 unfortunately)

Confirmed that 2.4 is the last working version. Downgrade successful.

2.5 & 2.6 give php error of "DateTime class not found". Halted site (WSOD without php error reporting set to display).

2.7 does not give any errors but will only display today's date (in both edit and content), though stored and used (in sorting, etc) correctly by the database upon entry.

karens’s picture

Status: Active » Fixed

This only affects old versions of PHP, which are ridiculously hard to support. I committed a fix to cvs that will make it work better, but things will never work completely right on these old versions.

justindavis’s picture

Thank you for the fix Karen.

Which files need to be patched?

I updated the file "date_api.module" to the most recent version in the Drupal-6--2 branch (rev. 1.64.2.5.2.124), but am still seeing the same problem -- all dates are mis-rendered as today.

justindavis’s picture

Whoops -- never mind. I was looking at a cached page. Updating the date_api.module file fixed the problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jillpadams’s picture

1/18 comments say a patch/fix was posted, but I can't find it and am still having the problem. Could someone post a link to where the patch lives? Sorry.

resting’s picture

prairiebean i had the same problem.
updated date_api.module with dev version as mentioned by justindavis and its working.

just have to comment the function date_increment_round(&$date, $increment) in line 2720 as there was a conflict.
Its displaying correctly now.

But yet to test if storing correctly.

LeXo’s picture

Date module was not adding new to dates but adding todays date, all i did is
deleted the lines below from modules/date/date_api.module or if your modules are in sites/all/modules/date/date_api.module:

if (get_class($date) != 'DateTime') {
$date = date_make_date($date);
}
if (empty($date)) {
return '';
}

Thanks, all from Big LeXo, Drupal is the way, enjoy, ONE LOVE! +256772870955, alex@keplerspace.com