Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
webform_install_profile.patch | 2.51 KB | quicksketch | |
Comments
Comment #1
quicksketchCommitted to D6 and ported to D5.
Comment #2
gregglesSo...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 :(
Comment #3
quicksketchFortunately 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
Comment #4
greggleswell. Thanks for the explanation.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.