If you use a Drupal install profile to install the date module, installation will fail with database errors. The offending code is on line 6 of date.install.
variable_set('date_version', drupal_get_installed_schema_version('date'));
If you use a Drupal install profile to install the date module, installation will fail with database errors. The offending code is on line 6 of date.install.
variable_set('date_version', drupal_get_installed_schema_version('date'));
Comments
Comment #1
karens commentedI'm trying to figure out why that would make a difference.
Comment #2
karens commentedOK, I'm guessing the problem is that that function does a database query on a table that has not yet been created. I tried moving that line inside the install() and update() functions to see if that will help and committed the changes to the HEAD version of the .install file. Can you test and see if it works that way? If so, I'll make the same changes to all branches. If not, I'll have to think of another way.
Comment #3
karens commentedNo response. I guess I'll assume that works and do it to all versions.
Comment #4
(not verified) commentedComment #5
Pedro Lozano commentedThis is still a valid issue,
there is code in the global scope in the following files:
date_api.install
date_timezone.install
date.install
date_php4.install
If any of these modules are enabled by an install profile these .install files are included by the drupal installer even before creating the drupal core tables, and calls to core functions like drupal_get_path or variable_set in the global scope will fail.
Temporary fix for users. With the code in the global scope do:
1. Comment the include_once lines in with drupal_get_path calls.
2. Move other initialization code to hook_install().
Comment #6
karens commentedI moved the code into a load function to get around this.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.