You cannot run install_set_block() to update any blocks when building a profile. In order to assign blocks to regions, etc, you must first run the _block_rehash() core Drupal function, which adds records to {blocks} for all modules (i.e. hook_block()).
FYI when themes are added it seems three blocks get added by default: Navigation, Powered by Drupal and User Login. As a result, upon completion of the installation only three records exist in {blocks} for each theme activated.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | install_profile_api-n399224-block_init.patch | 593 bytes | damienmckenna |
Comments
Comment #1
damienmckennaThe attached patch adds a function called install_init_blocks() which is simply a wrapper around _block_rehash().
Comment #2
James Andres commentedI wrote something similar once before. I found that calling _block_rehash() during installation caused the blocks to be setup under the minelli theme. This way annoying because I wanted to to use the theme I had enabled and set as default.
I used this trickery to get around the situation.
Useful?
Comment #3
damienmckennaThat could be useful. I also submitted #399212: install_default_theme() should set the $theme_key global, which is related.
Comment #4
James Andres commentedDamn, I just got burnt by this problem again.
DamienMcKenna, your original patch is the simplest solution along with the suggestion to update install_default_theme().
+1 for this, works well for me.
Comment #5
James Andres commentedCommitted.