I'm working on a custom install profile that has a default theme included. The theme which is in the profiles/[profile]/themes directory is not being discovered during the install process, so it cannot be set as default. I have figured out that if I have a copy the theme in the sites/all/themes or sites/[site]/themes directory that the theme is then discovered and set to default, as instructed by the profile, but once the cache is cleared after install the theme reverts to the same theme but in the profile directory (the themes have the same name but are slightly different to be able to tell the difference).
Any ideas?
Kale Worsley
Comment | File | Size | Author |
---|---|---|---|
#17 | 330297.patch | 1.38 KB | mig5 |
#11 | 330297.patch | 1.16 KB | jonhattan |
#7 | 330297_themes_in_install_profiles.patch | 1.28 KB | anarcat |
#3 | install-profile-themes.patch | 422 bytes | Stefan Freudenberg |
Comments
Comment #1
Stefan Freudenberg CreditAttribution: Stefan Freudenberg commentedHi. We have experienced the same problem which is not a themes problem but a bug in the install system. Themes are not recognized during installation because when they are determined first the profile global variable is unset. The theme info is cached in a static variable in _system_theme_data so it never recovers during the whole process. The attached patch solved the problem in our case, though it's far from elegant.
Comment #2
StevenPatzThere is no patch.
Comment #3
Stefan Freudenberg CreditAttribution: Stefan Freudenberg commentedHere it is. Sorry.
Comment #4
StevenPatzThere is a patch now.
Comment #5
mlncn CreditAttribution: mlncn commentedThis core bug still exists in all versions of Drupal 6.
Comment #6
anarcat CreditAttribution: anarcat commentedNote that it seems this is a regression from 5.x, as I can enable a theme in my install profile here, if it's profiles/hostmaster/themes/eldir. See #458362: enable the eldir theme on install if available for how I did it.
Comment #7
anarcat CreditAttribution: anarcat commentedI have redone the patch to remove code duplication and clarify the comments, it now needs testing. Note that this is now irrelevant in Drupal 7, as install.php is being rewritten (see #525594: Installation should consist of 2 phases instead of one and #524728: Refactor install.php to allow Drupal to be installed from the command line)
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedThe patch above has an unintended problem on a patched install.php of Drupal-6.13. It completely skips the 'Choose profile' stage of the install wizard, gives it the big green tick and moves straight to 'Choose language'. An install profile cannot thus be selected.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedThe earlier patch by stefan-agaric in #3 fixes this issue on Drupal-6.13
It's a desperately needed fix to D6 - without it, ugly hacks have to be made to work around it, that actually introduce other bugs as a result. See #534302: installation profile requires writable settings.php for one step further than expected/advised for an example. This patch clears up the mess.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #11
jonhattanHere is a fix to anarcat's patch.
Comment #12
jonhattanmarking this as critical (at least is critical for Aegir and also for all install profiles that provide a theme).
Comment #13
mikejoconnor CreditAttribution: mikejoconnor commentedThis issue also effects the new d.o. install profile packager. We ran into this issue with the Uberdrupal profile. I applied the patch, and it works as expected.
Comment #14
dwwWe just ran into this while testing http://drupal.org/node/657834. The new distribution packaging system puts themes under the profile directory, since that's supposed to be the best practice. However, install profiles like UberDrupal are trying to set a theme and that fails given this bug.
Note: this is a hacky way to fix this problem, but unless we introduce a $reset parameter to _system_theme_info(), I don't know how else we're supposed to clear the static $theme_info in there. :( This isn't a problem in D7 since we have drupal_static() there. Marking this a 6.15 blocker, since this really has the potential to cause a lot of problems once more packaged distros get off the ground.
Comment #15
Gábor HojtsyBugs are first fixed in the latest / development version of Drupal to avoid regressions in later versions. Also, the code comments can use some typo fixing, dots at end of sentence and empty line removal.
Comment #16
mikejoconnor CreditAttribution: mikejoconnor commentedI've tested d7, and it is not effected by this issue. See comment #14
Comment #17
Anonymous (not verified) CreditAttribution: Anonymous commentedHere's a reroll against d6
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedRight, well, I guess we can't call this a 6.15 blocker now that 6.15 is out.
Comment #19
David_Rothstein CreditAttribution: David_Rothstein commentedNote that a similar issue does exist in Drupal 7, and was reported at #585012: Setting a default theme in install profile causes WHACK errors -- looks like that probably should have been a duplicate of this one. However, it also seems the bug is much more serious in Drupal 6, so not sure what the proper thing to do is here? (We still want to make sure this gets fixed in Drupal 7 also.)
Anyway, it turns out that the latest (D7) patch at the other issue takes a similar approach as this one. The patch here looks correct to me for Drupal 6, but I haven't tested it.
Comment #20
john.karahalis CreditAttribution: john.karahalis commentedSubscribing. :-)
Comment #21
dwwI just tested patch #17 with uberdrupal 6.x-1.0-alpha5 -- worked like a charm. The patch is small and clean. It solves a critical bug that's breaking an important feature on drupal.org. D7 has a different installer and the API is different, and there's already a patch at #585012-9: Setting a default theme in install profile causes WHACK errors. It uses a similar approach, but since core changed, the patch is different. Please, please, please (did I mention please?) let's fix this now in D6. Let us not make multiple release of D6 core with this known bug while we await D7 converging on a solution. Please? ;)
Thanks!
-Derek
Comment #22
merlinofchaos CreditAttribution: merlinofchaos commentedI'm with dww -- this bug is blocking my ability to create one of the distros that I have on my plate. Getting this into the next Drupal release would be a big boon. I don't think it matters if D7 and D6 handle this one differently, it's the install process. You run it once and never see it again, all we care about in both cases is that it installs correctly.
Comment #23
john.karahalis CreditAttribution: john.karahalis commentedWe can confirm that dww's patch seems to work for Innovation News as well. With the patch applied, we are able to enable our custom, packaged theme without using any workarounds.
Comment #24
bjcool CreditAttribution: bjcool commentedsubscribe
Comment #25
adrian CreditAttribution: adrian commentedin my install profiles i always set the profile in the settings.php file
these are the related issues
#585012: Setting a default theme in install profile causes WHACK errors
#545452: Store install profile in the generated settings.php file
Comment #26
Gábor HojtsyCommitted to Drupal 6.
Comment #27
dwwYay, thanks!!! ;)