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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stefan Freudenberg’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hi. 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.

StevenPatz’s picture

Component: theme system » install system
Assigned: Unassigned » Stefan Freudenberg
Status: Active » Postponed (maintainer needs more info)

There is no patch.

Stefan Freudenberg’s picture

Status: Needs review » Postponed (maintainer needs more info)
FileSize
422 bytes

Here it is. Sorry.

StevenPatz’s picture

Status: Postponed (maintainer needs more info) » Needs review

There is a patch now.

mlncn’s picture

Version: 6.6 » 6.x-dev

This core bug still exists in all versions of Drupal 6.

anarcat’s picture

Note 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.

anarcat’s picture

I 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)

Anonymous’s picture

Status: Needs review » Needs work

The 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.

Anonymous’s picture

The 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.

Anonymous’s picture

Status: Needs work » Reviewed & tested by the community
jonhattan’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.16 KB

Here is a fix to anarcat's patch.

jonhattan’s picture

Priority: Normal » Critical

marking this as critical (at least is critical for Aegir and also for all install profiles that provide a theme).

mikejoconnor’s picture

Status: Needs review » Reviewed & tested by the community

This 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.

dww’s picture

We 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.

Gábor Hojtsy’s picture

Version: 6.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Needs work

Bugs 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.

mikejoconnor’s picture

Version: 7.x-dev » 6.x-dev

I've tested d7, and it is not effected by this issue. See comment #14

Anonymous’s picture

Status: Needs work » Needs review
FileSize
1.38 KB

Here's a reroll against d6

Anonymous’s picture

Issue tags: +drupal-6.16-blocker

Right, well, I guess we can't call this a 6.15 blocker now that 6.15 is out.

David_Rothstein’s picture

Note 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.

john.karahalis’s picture

Subscribing. :-)

dww’s picture

Status: Needs review » Reviewed & tested by the community

I 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

merlinofchaos’s picture

I'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.

john.karahalis’s picture

We 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.

bjcool’s picture

subscribe

adrian’s picture

in 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

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6.

dww’s picture

Yay, thanks!!! ;)

Status: Fixed » Closed (fixed)
Issue tags: -drupal-6.16-blocker

Automatically closed -- issue fixed for 2 weeks with no activity.