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 .install file fails when using an installation profile with a brand new site. This is because it's trying to call _block_rehash. I believe it's failing because drupal is not bootstrapped at this point.
Either a check for this function should be done, or this call should be removed. I'm wondering why it's even there? (I'm admittedly a newb.)
Comment | File | Size | Author |
---|---|---|---|
#7 | drupal_screen.png | 28.61 KB | cha0s |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedIt is there so that you don't have to manually enable the block. So, does anyone know of a better way to do that?
Comment #2
cha0s CreditAttribution: cha0s commentedLet the user enable it instead? ;)
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedYes, if we get no better ideas then thats what we will do.
Comment #4
salvisHaving it auto-enabled is nice, because the module doesn't do anything without the block.
We could check for _block_rehash() before calling it, then it wouldn't fail in an installation profile, but it wouldn't be working either, so there'd be no point in putting it into the installation profile.
If the user has to manually enable the block, then he may as well manually enable the module, or am I missing something?
Comment #5
cha0s CreditAttribution: cha0s commentedYeah, you definitely have a point. Although I think at the very least it should be able to be installed in an installation profile without borking everything else as it currently does, however maybe there should just be a warning thrown if the _block_rehash function isn't usable.
Take DHTML menu for instance, when you install it in an installation profile, it gives you a link afterward to actually enable the menus, maybe that concept could be reused for devel_node_access to enable the block?
Comment #6
salvisI looked at DHTML Menu. It's a one-shot message from hook_enable(). Does that really work in an installation profile? How does it scale? What if all modules in the profile do this?
Comment #7
cha0s CreditAttribution: cha0s commentedIt seems that the messages will "stack" on the finished installation screen. I have attached a screenshot from Drupal 5 (which in this case, devel_node_access has been removed for now...)
The installation profile I'm using can be found here: http://therealcha0s.net/ubercart/ubercart_test.profile
If those messages are being displayed using hook_enable, then I guess that's the proper place to put _block_rehash(). :)
Comment #8
salvisThanks for the screenshot!
Let's take a step back:
@moshe:
Is it really needed? My testing on D5 shows that the DNA block shows up automatically, even if _block_rehash() isn't called explicitely.
Could this be a left-over of D47?
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedI guess it could be. I'm OK with removing this from hook_install()
Comment #10
salvisOk, committed to all three versions.
Sorry about taking the long road, cha0s...
Comment #11
cha0s CreditAttribution: cha0s commentedNo problem, thanks for committing it.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.