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.
Problem
- Installing Drupal with Minimal profile yields a site that is minimal with regard to modules, but not with regard to its theme.
- A site installed with Minimal profile gets all the theme variables/configuration of the Bartik theme, despite no longer used later on.
Goal
- Make "Minimal" mean "minimal" and allow users to create new sites with new themes without presumptions.
- Prevent Drupal from polluting the system configuration with Bartik stuff for Minimal profile.
Details
- The Minimal profile is primarily used by site builders, who already know that they do not want all of the regular default modules and configuration.
- Sites being built with Minimal profile usually get a completely custom theme. Since themes cannot be uninstalled, the entire Bartik configuration remains active forever.
- Bartik presets too much of Drupal's default visual design, which can hinder an independent and open-minded design process.
Proposed solution
- Remove the default theme re-configuration from Minimal profile, so that it uses Stark.
Original report:
I'm not sure if this is a good idea or not, but I figured I'd throw it out there for discussion. There's nothing more minimal than Stark, after all. ;)
Comment | File | Size | Author |
---|---|---|---|
#37 | drupal8.minimal-stark.37.patch | 1.41 KB | sun |
#20 | drupal8.minimal-stark.20.patch | 1.39 KB | sun |
#14 | stark_minimal_theme_default.patch | 867 bytes | rjgoldsborough |
#11 | stark_default_minimal_theme.patch | 568 bytes | rjgoldsborough |
#9 | stark_default_minimal_theme.patch | 1.86 KB | rjgoldsborough |
Comments
Comment #1
jbrown CreditAttribution: jbrown commentedSee also #815020: Make Seven the default theme for profile Minimal.
We are currently installing two themes - which isn't very 'minimal'.
Comment #2
webchickToo late for this in D7, but I seriously think we should do this in D8. ;) I might even write the patch. :D
Comment #3
JacineThis would be great, and doing it quickly would help dramatically with what I'm looking to accomplish from a CSS cleanup standpoint.
Comment #4
tstoecklerCrosspost? Reverting version.
Comment #5
JacineOops! Thanks @tstoeckler.
Comment #6
rjgoldsborough CreditAttribution: rjgoldsborough commentedHere is a patch that sets the default theme to Stark based on an install using the Minimal profile.
Comment #7
rjgoldsborough CreditAttribution: rjgoldsborough commentedI think it got skipped because of the d8 prefix? I can't find the docs where I think I read that. Anyways, another try with renamed patch.
Comment #8
webchickAwesome! :D
Except, we don't want to put profile-specific logic in system_install(). This should be something that happens in profiles/minimal/* only.
Comment #9
rjgoldsborough CreditAttribution: rjgoldsborough commentedThis one should do it.
Comment #10
webchickInteresting. So a one-liner variable_set('theme_default', 'stark'); doesn't cut it?
Comment #11
rjgoldsborough CreditAttribution: rjgoldsborough commentedNot quite one line. But what I had was too much as well. One reason for no is the line: $default_theme = variable_get('theme_default', 'bartik'); If we were to only make the one line change the variable wouldn't match below. But we can make it a two liner quite easily.
Comment #12
webchickHah, perfect! :) Works great! The admin theme gets switched, too.
Something that's weird though is that when I install w/ minimal and navigate over to admin/appearance, Bartik is listed as an enabled theme, and Stark is not. Hm.
OH. I get what you were doing in #7 now. There's this hunk of code in system_install():
That's totally, totally wrong. :( That forces Bartik to be installed and enabled on every single new Drupal site, regardless of what the install profile says. I made a separate issue for discussing this, however, at #1022386: Don't force install profiles to undo system_install()'s setting of a default theme because that might go down a whole rat-hole, whereas this patch is very simple.
The one tiny nit-picky thing I could say about this is that there ought to be a newline before the
// Enable some standard blocks.
line, just to preserve whitespace. Once that's done, this looks ready to fly for me. :)Comment #13
tstoecklerThe only reason for sticking $default_theme into a separate variable, instead of directly putting 'stark' everywhere, is to make it easier to change the default theme later on. We use the indirection of variable_get() (with a default value of 'bartik'), so that the code below works with and without a preceding variable_set(). Since we now want a custom default theme, we precede the variable_get() with a variable_set() and all is well. So far, so good.
BUT: There is no need to change the default value of variable_get(), because as long as we precede that with the variable_set(), the variable_get() will always return 'stark'. And if we ever remove the variable_set() we still want the profile to work, and we want it to use the system-default, which is 'bartik'. That's the entire point of this indirection. Otherwise we could just do $default_theme = 'stark';
Powered by Dreditor.
Comment #14
rjgoldsborough CreditAttribution: rjgoldsborough commented@webchick - From a little bit of digging, it looks like, that even though the patch works and stark is the default theme, it never does get enabled. Certainly not on the appearance page and not in the db either. This patch enables stark and disables bartik. Whitespace also fixed.
@tstoeckler - Very good point, I hadn't really though of that. I would totally agree but when I do set the fallback value as bartik, this patch breaks, and still uses parts of bartik. I plan to do more digging but wanted to post the patch/issue.
Comment #15
rjgoldsborough CreditAttribution: rjgoldsborough commentedComment #16
tstoecklerI don't think we want to force everyone who wants to alter the theme in their profile to write that much code. We should fix the root of the problem, which seems to be both variable and theme system not really functioning at this point.
Comment #17
mlncn CreditAttribution: mlncn commentedSee also the interim solution for testing (use Stark for the Testing profile) http://drupal.org/node/719814#comment-5147204 and the duplicate issue #1181776: Change theme_default variable to Stark
Comment #19
David_Rothstein CreditAttribution: David_Rothstein commentedMoving this to the install system queue since it involves the user experience of the installer (and we don't have issue queues for the profiles currently)... also, that's where #1181776: Change theme_default variable to Stark is (which had some arguments both for/against this change).
Comment #20
sunYes, please. Bartik presets way too many visual defaults.
Attached patch removes the default theme configuration from Minimal profile.
It also removes the configuration for the system main content and help blocks, since those should be automatically placed correctly due to #1373312: Assign system_main block to 'content' region and help block to 'help' region by default (followup) already.
Comment #21
RobLoachAre there any other follow ups that could remove more from the minimal profile?
BTW, Winter is Coming.
Comment #22
webchickDries has been opposed to this in the past, so assigning this to him to review.
Comment #23
sunI've updated the issue summary.
Comment #24
sun#20: drupal8.minimal-stark.20.patch queued for re-testing.
Comment #25
sun#20: drupal8.minimal-stark.20.patch queued for re-testing.
Comment #26
webchickRegarding #22, the comment I refer to is #1181776-34: Change theme_default variable to Stark.
Comment #27
sunOne month of waiting and inactivity on an issue in the RTBC queue is way too much and unacceptable.
I'm hereby applying #1399824: [policy] Formalize min/max time thresholds for RTBC patches to this issue.
Therefore, I'm delegating this issue from @Dries to @webchick due to unresponsiveness. The delegation seems sensible to me, since @webchick and I happen to have very different visions on installation profiles in Drupal core, so this re-assignment is not in my and my patch's favor. ;)
On the actual change:
For one, please note the issue summary.
Second, we happened to discuss this already in IRC, and dissecting @Dries' response from that other issue basically means that "Minimal" + its description is a poor presentation of the Minimal profile's purpose and intentions. This totally can be improved, but also, that's totally out of scope for this issue. Hence, created a follow-up for that: #1664894: Clarify Minimal profile's use-case and description
Comment #28
webchickEr. It's a month where we were over thresholds, so there was no reason to work on a feature request issue. I still think this is fundamentally a "product owner" decision, aka Dries.
However, my stance on this is is I agree with Dries's concerns. Which means if we committed this patch without #1664894: Clarify Minimal profile's use-case and description, we would have to escalate that issue to a critical release blocker, while this is only a nice to have. So I actually think we should address both in the same patch.
Comment #29
sunHold on. This is not "only nice to have". The issue summary states technical reasons for why it is bad to enable a theme that won't be used afterwards.
Contrary to that, the discussion on properly labeling/describing Minimal profile to end-users might possibly take weeks on its own to resolve. No need to tell me that UX and especially initial UX highly matters, but reality is that these are two completely detached and independent tasks and discussions.
But anyway - we sat together in IRC and came up with a very nice and concise new description for Minimal profile, which is already RTBC: #1664894: Clarify Minimal profile's use-case and description :)
Therefore, tentatively also moving this back to RTBC. Totally not meant to fight or overrule anyone, but instead solely on the grounds that we have a fantastic solution for the other issue already, and because that was the only concern raised against this patch.
Comment #30
sunCan we move forward here?
It seems clear by now that the main concern on this change will be addressed by #1664894: Clarify Minimal profile's use-case and description. That's a pure user interface text issue though, which does not change the scope, use-case, and target audience of the Minimal profile.
Less important, but still, relevant: I'm also very close to replace the default profile for running tests with the Minimal profile — so as to free up the Testing profile from its current constraints and make room for the Testing Framework Next™.
Comment #31
sun#20: drupal8.minimal-stark.20.patch queued for re-testing.
Comment #32
webchickWell, we are still over thresholds, so I am not sure what exactly you want to happen here. I also laid out the plan of attack I wanted to happen based on Dries's concerns, and instead of fixing that here, you split it into another issue which is not RTBC yet, so AFAIK there's nothing for a core committer to do in this issue yet.
In general though, core committers have been allocating their time on critical/major issues that unblock initiatives, which IMO is exactly where they should be spending time, and those issues unfortunately typically take many, many hours to properly review which doesn't leave much remaining time for smaller patches like this. After I get back from vacation in a week or so I'll probably do another pass of the RTBC queue in descending order of priority like I did last month, assuming we're under thresholds at that time.
Comment #33
sunI spent the weekend to get us back below thresholds (again).
I also tried to address that concern about the plan of attack in the last comments here -- the user interface text improvement for the install profile's description will not change the fundamental use-case of Minimal profile.
It doesn't feel appropriate to me to hold off this change, just because the install profile is described/presented in a poor/misleading way; that's a separate issue, which apparently requires its own discussion and wordsmithing (which I pushed forward as much as possible, too).
Comment #34
webchickJust as an update here, despite an epic (and much appreciated!) triage effort by sun a couple of weeks ago, we are unfortunately still over thresholds w/ criticals. :\ Hopefully the situation will look better though at the end of DrupalCon. :D
Comment #35
sun#20: drupal8.minimal-stark.20.patch queued for re-testing.
Comment #37
sunRe-rolled against HEAD.
The situation with thresholds is a bit weird here. I invested a lot of time to get us below thresholds, so this patch can get in, but when we were below thresholds, the patch didn't see any attention, and meanwhile, we seem to be back over thresholds again (not verified whether that's still the case). So essentially, I could as well have not invested the time to get us below thresholds. Very weird, and a bit demotivating. The thresholds are working fine otherwise, but this seems to be a flaw in the system.
Comment #38
Dries CreditAttribution: Dries commentedI thought about this some more and decided to commit this. Sorry it took this long.
Given the work you've been doing on D8, I've decided to commit both #1664894: Clarify Minimal profile's use-case and description and #632100: Use Stark as default theme for Minimal install profile regardless of the fact we are over threshold. It's an exception, but thanks for all your hard work.
Comment #39.0
(not verified) CreditAttribution: commentedUpdated issue summary.