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

  1. 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. ;)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jbrown’s picture

See also #815020: Make Seven the default theme for profile Minimal.

We are currently installing two themes - which isn't very 'minimal'.

webchick’s picture

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

Too late for this in D7, but I seriously think we should do this in D8. ;) I might even write the patch. :D

Jacine’s picture

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

This would be great, and doing it quickly would help dramatically with what I'm looking to accomplish from a CSS cleanup standpoint.

tstoeckler’s picture

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

Crosspost? Reverting version.

Jacine’s picture

Oops! Thanks @tstoeckler.

rjgoldsborough’s picture

Status: Active » Needs review
FileSize
1.86 KB

Here is a patch that sets the default theme to Stark based on an install using the Minimal profile.

rjgoldsborough’s picture

FileSize
1.86 KB

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

webchick’s picture

Status: Needs review » Needs work

Awesome! :D

Except, we don't want to put profile-specific logic in system_install(). This should be something that happens in profiles/minimal/* only.

rjgoldsborough’s picture

Status: Needs work » Needs review
FileSize
1.86 KB

This one should do it.

webchick’s picture

Interesting. So a one-liner variable_set('theme_default', 'stark'); doesn't cut it?

rjgoldsborough’s picture

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

webchick’s picture

Status: Needs review » Needs work

Hah, 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():

  // Enable the default theme.
  variable_set('theme_default', 'bartik');
  db_update('system')
    ->fields(array('status' => 1))
    ->condition('type', 'theme')
    ->condition('name', 'bartik')
    ->execute();

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. :)

tstoeckler’s picture

+++ profiles/minimal/minimal_new.install	2011-01-10 21:07:04.951099481 -0500
@@ -7,8 +7,10 @@
+  variable_set('theme_default', 'stark');
+  $default_theme = variable_get('theme_default', 'stark');

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

rjgoldsborough’s picture

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

rjgoldsborough’s picture

Status: Needs work » Needs review
tstoeckler’s picture

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

mlncn’s picture

See 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

Status: Needs review » Needs work

The last submitted patch, stark_minimal_theme_default.patch, failed testing.

David_Rothstein’s picture

Component: base system » install system

Moving 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).

sun’s picture

Assigned: Unassigned » sun
Status: Needs work » Needs review
FileSize
1.39 KB

Yes, 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.

RobLoach’s picture

Status: Needs review » Reviewed & tested by the community

Are there any other follow ups that could remove more from the minimal profile?

  1. Installed a minimal site
  2. Saw Bartik was being used
  3. Deleted site
  4. Applied patch
  5. Installed a new minimal site
  6. Saw beautiful Stark was being used

BTW, Winter is Coming.

webchick’s picture

Assigned: sun » Dries

Dries has been opposed to this in the past, so assigning this to him to review.

sun’s picture

I've updated the issue summary.

sun’s picture

#20: drupal8.minimal-stark.20.patch queued for re-testing.

sun’s picture

#20: drupal8.minimal-stark.20.patch queued for re-testing.

webchick’s picture

Regarding #22, the comment I refer to is #1181776-34: Change theme_default variable to Stark.

sun’s picture

Assigned: Dries » webchick

One 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

webchick’s picture

Status: Reviewed & tested by the community » Needs work

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

sun’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +Platform Initiative

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

sun’s picture

Title: Use Stark on the minimal profile » Use Stark as default theme for Minimal install profile
Assigned: webchick » sun
Issue tags: +Testing system

Can 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™.

sun’s picture

#20: drupal8.minimal-stark.20.patch queued for re-testing.

webchick’s picture

Well, 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.

sun’s picture

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

webchick’s picture

Just 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

sun’s picture

#20: drupal8.minimal-stark.20.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +Testing system, +Platform Initiative

The last submitted patch, drupal8.minimal-stark.20.patch, failed testing.

sun’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1.41 KB

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

Dries’s picture

Status: Reviewed & tested by the community » Fixed

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

Status: Fixed » Closed (fixed)
Issue tags: -Testing system, -Platform Initiative

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.