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

karens’s picture

I'm trying to figure out why that would make a difference.

karens’s picture

OK, 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.

karens’s picture

Status: Active » Fixed

No response. I guess I'll assume that works and do it to all versions.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Pedro Lozano’s picture

Version: 5.x-1.4 » 6.x-1.0-beta
Status: Closed (fixed) » Active

This 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().

karens’s picture

Status: Active » Fixed

I moved the code into a load function to get around this.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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