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.
In Panopoly 1.x, we had panopoly_theme.profile.inc that we could include a distro's installer and call a couple functions to add a theme selector step to the installation process. This issue is to port that to Drupal 8!
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff_1_5.txt | 1.62 KB | shadcn |
#5 | panopoly-theme-selector-2728715-5.patch | 10.63 KB | shadcn |
#2 | panopoly-theme-selector-2728715-1.patch | 11.06 KB | shadcn |
Comments
Comment #2
shadcn CreditAttribution: shadcn at Chapter Three commentedHere's a first patch that adds the theme selection install tasks.
Adding this to a custom distro's installer is same as before:
Comment #3
dsnopekAwesome! Works perfect in my testing. :-)
However, I have one question/concern from looking at the code: This patch moves the
panopoly_install_tasks(()
from panopoly.install to panopoly.profile. That's where we had it in Panopoly 1.x, but my impression was that it was better to put in the .install file because that's only loaded during installation, whereas the .profile file is loaded always (like a .module file) under the normal operation of the site. That said, I don't know if that's actually accurate. :-)Do you know if I'm right or wrong about that? Is there a reason you had to move it from panopoly.install to panopoly.profile? If that's necessary to make this work, that will decide this for us.
Thanks!
Comment #4
shadcn CreditAttribution: shadcn at Chapter Three commentedI looked into this a bit more.
I remember back in Drupal 7 we had some issues with
hook_install_tasks
in.install
and Batch API. The fix was to put it in.profile
. I believe this has been fixed now.Looking at the code of some major distributions it seems they all implement this hook in
.profile
. I've been doing the same but I don't see any documentation backing this up.Moreover, I ran some tests to check if
.profile
is still loaded on every request and it still is.But here's an interesting piece of code I found in
install.core.inc
:It looks like Drupal assumes
hook_install_tasks
is in.install
🤔Comment #5
shadcn CreditAttribution: shadcn at Chapter Three commentedHere's an updated patch.
Comment #7
dsnopekThanks! Committed :-)