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/Motivation
Currently, there are for every theme setting two functions. One for the global and one for the user-specific value.
I think we could refactor the logic to make it more generic and easier in the future to add new settings.
Maybe we should keep the current setting names to keep it backwards compatible as possible.
Talking about
enable_darkmode: false
classic_toolbar: 'vertical'
Comment | File | Size | Author |
---|---|---|---|
#4 | 3203078-4.patch | 13.83 KB | chr.fritsch |
| |||
#2 | 3203078.patch | 12.92 KB | chr.fritsch |
|
Issue fork gin-3203078
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
chr.fritschHere is my suggestion. I added a service that handles the logic
Comment #4
chr.fritschFixing the tests and CS issues
Comment #7
chr.fritschI think this is fine for now. I wouldn't change more. We can refactor more on other issues.
Comment #8
chr.fritschI removed the update hook, because themes are not able to declare those. So it was sadly useless.
Comment #9
saschaeggiSee my questions in the PR :)
Comment #11
volkerk CreditAttribution: volkerk at Thunder commentedComment #14
saschaeggiAdded a Tugboat Live Preview Build to this issue.
Some stuff which needs work:
- Setting: "Users can override Gin settings" => should be disabled on a new installation
- Theme breaks with gin_toolbar for now (gin_toolbar would need refactoring as well I guess)
Comment #15
volkerk CreditAttribution: volkerk at Thunder commentedComment #16
chr.fritschAfter installing in 3.x and then switching to the branch, the settings are still applied correctly, but in the settings form, the current values are not selected.
Comment #17
chr.fritschLooks good to me now
Comment #18
saschaeggiThanks a lot @volkerk & @chr.fritsch for your heavy work on this 💙👏