Closed (fixed)
Project:
Block Inject
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2013 at 18:07 UTC
Updated:
29 Apr 2013 at 14:30 UTC
Jump to comment: Most recent file
Over at the Block Group module I had a nasty problem with hook_info_alter sometimes not being called when theme-info was rebuilt during an early bootstrapping phase. See #1941246: Cache clears sometimes cause blocks to become disabled and af07f0c for a workaround.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | block_inject-bootstrap-update-1958132-2.patch | 444 bytes | upchuk |
| #2 | block_inject-bootstrap-update-#1958132-#2.patch | 444 bytes | upchuk |
Comments
Comment #1
upchuk commentedThanks znerol!
I will make the changes and add a hook_boot() as well.
Thanks for the catch!
Comment #2
upchuk commentedI rolled a patch for this purpose if you want to apply it.
Let me know if there is anything else.
Thanks a lot for your help!
Comment #3
upchuk commentedSorry, I think there was a problem with the filename and I couldn't edit my earlier comment attachment which is weird..
Comment #4
znerol commentedI confirm that the fix you committed to the dev version works. FYI, my strategy for testing this was to create a new file
inject-test.phpnext to theindex.phpwithin the drupal root directory.inject-test.php:Ensure the bug is present in stable:
inject-test.phpEnsure that the bug is fixed in dev: Same procedure as above but use dev version. The injected region now should survive
inject-test.php.A minor note on the issue status: patch (to be ported) is used when a patch has been applied to one branch (e.g. 7.x-1.x) but still needs to be adapted for another branch (e.g. 6.x-1.x). See the handbook for more info.
Comment #5
znerol commentedAnother note: The bootstrap-status of modules is only updated (using _system_update_bootstrap_status) when:
The latter is called from within update_finished. Because you already implemented an update-function in the other issue, you do not need to take additional actions to ensure that the bootstrap-status of the block inject module is correct.
Comment #6
upchuk commentedCool,
Thanks for testing it out and letting me know. I will soon add a new release.
Also thank you for the tips on the status :)
There is one thing I do not fully understand though: I am a bit confused as to what you mean in comment #5.
Thanks!
Comment #7
znerol commentedThe system table in the database has a field indicating whether modules should be loaded early during bootstrapping. This field is called bootstrap. A module is only loaded early if this bootstrap-field is set to 1.
Drupal decides whether this bootstrap-field should be set in the system-table when modules are enabled or disabled or after a database upgrade finished.
Because your module did not implement any bootstrap-hook (like hook_boot) before, it was not marked as a bootstrap-module in the system table in current installations. When you simply add a bootstrap-hook, the bootstrap-flag in the system table of the database is not automatically updated. Except on one of the occasions I mentioned above.
Comment #8
upchuk commentedCool, thanks for the clarifications. So because in the other issue I added an update hook, when existing installations will update the module, the bootstrap flag will also be updated if I understood correctly :)
Cheers!
Comment #9
znerol commentedExactly.
Comment #10
upchuk commentedCool! Thanks