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.
I usually test my new themes within a test environment but sometimes I need to test on the production site.
I would like to be able to awitch to a theme without having the need to enable it first. Especially because I need some user-roles (that have permission) to review those themes before enabling them.
I would like propose attached patch:
- adds a permission "switch to non-enabled theme"
- If you have permission to use non-enabled themes there will be a small note ön the theme switch form saying: "Non-enabled themes available".
- Corrected some coding-standard-things
Comment | File | Size | Author |
---|---|---|---|
#9 | nonenabled_d5.patch | 1.27 KB | clivesj |
swt_non_enable.patch | 1.56 KB | clivesj |
Comments
Comment #1
sunI like this idea. However, your coding-style needs work, see http://drupal.org/coding-standards for further information.
Comment #2
clivesj CreditAttribution: clivesj commentedThanks Sun, can you point some more specific where I missed the standards?
Comment #3
sun- Insert a space after the comma to separate array values.
- Use 2 spaces instead of tabs.
- Else is always on the next line, same indent as If.
...if you already read the coding standards section in the handbooks, then read it again, please. All of this is clearly stated there. Either read, understand, and adapt Drupal's coding standards, or do not post patches. Thanks.
Other than that:
- $note is not initialized.
- We do not use dirty HTML hacks like the one in #suffix in Drupal.
- You accidently removed the form submit button in switchtheme_switch_form().
Comment #4
clivesj CreditAttribution: clivesj commentedThanks for the pointers,
I will re-do my homework and re-supply a patch
Comment #5
christefano CreditAttribution: christefano commentedI've noticed on occasion that for anonymous visitors, Switchtheme somehow switched to a theme after the theme has been disabled. It's strange to see this as a feature request.
Comment #6
sun@christefano: This issue is a feature request. What you are reporting is a completely separate issue. Please open a new bug report for it. Thanks.
Comment #7
christefano CreditAttribution: christefano commented@sun: I'm aware that this is a feature request and noted that in my comment. If you prefer that I just write "subscribing" instead please let me know. :)
Comment #8
sunAny updates?
Comment #9
clivesj CreditAttribution: clivesj commentedHere's a patch i'm using on my D5 site.
I will install and test the D6 version on my D6 site and provide the patch when ready.
regards
Comment #10
sunUhm - why not simply:
s/non-enabled/disabled/ ;)
I don't think this description is of any help...
Instead, we should store $attr->name as key and "@themename (disabled)" as value for $options here.
Beer-o-mania starts in 20 days! Don't drink and patch.
Comment #11
mikesir87 CreditAttribution: mikesir87 commentedIs this in the current version of the code? I am able to switch to the Garland theme, even when it is not enabled. I see this as being a problem, so would like to suggest creating a permission to allow someone to switch to a non-enabled theme. I don't want anonymous users to be able to switch to any theme they want.
Thoughts?