I was attempting a fresh install of date on a new D6.2 system(fwiw, cck 6.1-dev, PHP 5.2.1). When attempting to activate date_timezone (a prerequisite for date) at admin/build/modules , I received
Fatal error: Call to undefined function timezone_identifiers_list() in /home/sites/all/modules/date/date_timezone/date_timezone.install on line 208
That function is defined in date_api.module, which is supposed to be included on line 5 of date_timezone.install with include_once('./'. drupal_get_path('module', 'date_api') .'/date_api.module');. This, however, is an invalid path as date_timezone.install is in the date_timezone subdirectory, not in the date module root directory.
Changing line 5 to include_once('../'. drupal_get_path('module', 'date_api') .'/date_api.module'); allowed the installation to proceed, as did simply using include_once(drupal_get_path('module', 'date_api') .'/date_api.module');. Not being strong in PHP I did not know if one is considered better practice, so I did not submit a patch.
Comments
Comment #1
pal_ur commentedSame in 6.x-2.0-beta. In this case the solution is to set
include_once(drupal_get_path('module', 'date_api').'/date_php4/date_php4.inc');as include path.Comment #2
karens commentedThe original issue makes no sense. PHP 5.2.1 has a native function timezone_identifiers_list() that should always be there. Are you sure about your PHP version?
#1 looks like someone running PHP 4 that didn't get the wrapper function included, which looks more like the genuine issue. I need to test an installation under PHP 4, but don't have time right now. I'll try to get back to this soon. It shouldn't be a problem once you get past the installation.
Comment #3
choster commentedI am definitely on PHP 5.2.1, but is it possible a library is missing?
http://www.smyadc.org/phpinfo.php
Comment #4
ShawnClark commentedJust did some testing of the Date module install on a 5.7 drupal site with php 4.4.7 installed.
There is definitely a need to have the date_php4.module included within the install if you are on a php install that isn't 5.2
I tested this by first trying it with a base install of the Date module (5.x-2.x-dev) and it gave the same error as originally reported. I then disabled all the modules and uninstalled. Once clean I then added the one line and and enabled the Date modules. The second time the install gave no error and everything installed.
Comment #5
millions commentedsubscribing
Comment #6
karens commentedI committed some changes removing the './' prefix from the includes and trying to auto-enable date_timezone and date_php4 in various places in the install files. I'm not totally sure I found the right places to do it -- installs and updates don't happen in a predictable order, so it's hard to be sure where to do these things so that everything will always work.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.