Remove DEFAULT_THEME handling - #32056
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
| 'callback' => 'call://themes/getAvailable', | ||
| ), | ||
| 'default' => 'default', | ||
| 'default' => 'minetta', |
There was a problem hiding this comment.
If we really think that the theme setting should be explicit, then maybe this should be 'none'?
|
Hmmm test gods angry again 🙄 |
|
Jenkins retest this please |
e534609 to
47edf98
Compare
|
I'm not sure why in the context of I tried to simulate hook_civicrm_themes when both Greenwich and Riverlea are enabled in
edit Conclusion: even if tests pass, they aren't testing anything Riverlea. |
47edf98 to
f69eb7a
Compare
f69eb7a to
bd28191
Compare
|
This is a tricky one. Kudos for keeping it moving. The idea of
|
|
Sorry I should have put this back to draft. I was mainly trying to get my head around some of the logic in
Yes I don't like the naming either. But what I was trying to achieve was:
This is the scenario I'm trying to address, but my thought process was different. I was thinking instead of a random theme fallback, you should get unthemed (functional) css only. This should allow the admin to navigate the site to rectify the situation. But it's very obvious that you haven't got the theme you wanted, and you need to do something about it. The concern with "pick another available theme" is a situation where you might not realise it's switched. E.g. for some reason you've disabled Riverlea, and then your switched from Minetta to Greenwich, and as an admin you don't actually realise because on the surface they are quite similar. Meanwhile, on some frontend page that was built based on Riverlea, users are getting a borked site. If we think "admins should always make an explicit theme choice", then having something that on the face of it looks safe might actually have hidden dangers. All that said, it seems the boundary between |
In what sense is it only half defined? It seems well defined to me. (Though not doing quite what I'd like.) |
In this sense: the contract between app-html and theme-css is a list of tags/classes. The practical impact is circumstantial. For example:
Ah, OK, I think that's an idealized distinction. For example, using On the left, there's the obvious aesthetic effect of being unthemed (tabs become bullets; inputs misalign). But also (on the right) the
True! CRM_Core_Session::setStatus(
ts('The configured theme (%1) is unavailable. The system has auto-selected an emergency fallback. Please update the <a %2>Display Preferences</a> or enable a <a %3>suitable extension</a>.', [
1 => htmlentities($theme),
2 => sprintf('href="%s"', Civi::url('backend://civicrm/admin/setting/preferences/display?reset=1', 'h'),
3 => sprintf('href="%s"', Civi::url('backend://civicrm/admin/extensions?reset=1', 'h'),
]),
ts('Theme Warning')
); |
Idealised, sure, but important. The Manage Extensions is a case in point. Today you can use with just However, if your fallback is "pick any theme" and the only one left is NO_STYLES, then the site builder will get stuck unable to re-enable a theme. Essentially I think whilst stripping out the dependency on Greenwich (specific theme) we should be aiming to retain a minimal layer of functional css. (In an ideal ideal world the html markup would be such that it would be basically functional without css, but obviously we're not there.) Two further thoughts:
|
|
@totten - nudge on this, particular the most pertinent point:
|


Overview
Remove DEFAULT_THEME handling and Greenwich dependency. Follow up to #31985
Before
default= "Automatic" theme option, which gives you GreenwichAfter
default= "Automatic" theme optionComments
--------‐‐------------
In previous PR's @totten concluded that the theme setting should have an explicit value. Based on this I think its reasonable that an invalid value falls back to no theme (just core css) => indicates to the user they need to pick a theme. This also avoids any dependency on any specific theme.