I've read all the references regarding PHP fatal errors with these functions. I even attempted to apply the following suggestion to our .htaccess file: http://drupal.org/node/263730. Doing so crashes the Drupal Advertisement module.

Every time I try to use create_date() in code, I get a fatal error. For example:

PHP Fatal error:  Call to undefined function create_date() in /htdocs/sites/all/themes/garland/template.php on line 179

We are running PHP 5.2.3 on our development servers and PHP 5.2.6 on our production server.

CommentFileSizeAuthor
#4 create_date.patch1.49 KBasimmonds
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ron_s’s picture

Also I will add we do not have the Date PHP4 module enabled, since we are running such new versions of PHP. Really saw no reason we needed to do this.

asimmonds’s picture

Should this function be date_create()?

ron_s’s picture

Status: Active » Needs review

Ah hah! Thank you very much ... that's what I get for following the instructions. :) Please correct the first example in the date/README.txt file to read:

$date = date_create('2007-03-11 02:00:00', timezone_open('America/Chicago'));
$chicago_time = date_format('Y-m-d H:i', $date);

Instead of ...

$date = create_date('2007-03-11 02:00:00', timezone_open('America/Chicago'));
$chicago_time = date_format('Y-m-d H:i', $date);
asimmonds’s picture

Version: 5.x-2.0-rc » 5.x-2.x-dev
Component: Code » Documentation
FileSize
1.49 KB

And the patch (also fixing another occurrence of create_date())

KarenS’s picture

Title: PHP Fatal error: Call to undefined function create_date() » Documentation error uses create_date() instead of date_create()
Status: Needs review » Fixed

I missed the fact that the documentation had that transposition. Fix committed to both 5.x and 6.x. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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