The query at the beginning of the fivestar.install file prevents Fivestar from being used in an install profile. During installation, the system table isn't yet initialized, so the query causes a mySQL error that halts the installation.

webform_install_profile.patch2.51 KBquicksketch


quicksketch’s picture

Status:Needs review» Fixed

Committed to D6 and ported to D5.

greggles’s picture

So...there are a lot of bugs about not being able to use Pathauto in install profiles because it causes a whitescreen. I think a lot of them were related to people doing it without token...but that's now been fixed (mostly).

This problem you found here could also be a problem for a lot of modules, though, since they all try to set their weights during install. Any insight on that? Sorry for asking a relatively off topic question here...I looked for you in irc and didn't see you :(

quicksketch’s picture

Fortunately it's not a large problem, it just takes a small amount of tweaking. The only time in which the system table is not available is when install profiles load all the .install files to check their hook_requirements() $stage == 'install'.

So it's fine to do any queries on the system table as long as you're in hook_requirement() $stage == 'runtime', or inside of any other function like hook_install(). Fivestar had the problem that it made a query at the top of the file, other modules like date and CCK had a problem because they called drupal_get_path() to pull includes at the top of the file (drupal_get_path queries the system table to find the install path).

Basically, don't use any code outside a function in the install file :)

See #285138: CCK 6.x Cannot Be Set Up in Install Profiles

greggles’s picture

well. Thanks for the explanation.

Anonymous’s picture

Status:Fixed» Closed (fixed)

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