-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Changing color scheme resets session settings to defaults (#7407)
* Fix: incorrect saveing of color scheme in CMS.settings * Add: changelog entry :-)
- Loading branch information
Showing
2 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fcfe77f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fsbraun , sorry for the delay.
I applied this patch to my CMS repository and rebundled everything. Unfortunately it does not have the desired effect.
Currently my workaround is to return immediately from this function:
https://github.com/jrief/django-cms/blob/df8d94156a80172e2b3d4d0872cd9a4cdf0ca3c7/cms/static/cms/js/modules/cms.toolbar.js#L809
which of course is a dirty hack.
fcfe77f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jrief ! Thanks for the update! That's very strange. I have explicitly tested for page tree settings to be preserved. Of course, you were right to run
gulp bundle
. As obvious as it is, I have found that sometimes I need to clear my browser cache forcefully to see changes of the new bundle taking effect (more often on Chrome than on Safari).The less dirty way to patch is to just leave out the call to
setSettings
just in the line after yourreturn
. Also, you can setCMS_COLOR_SCHEME_TOGGLE
toFalse
in yousettings.py
to not show the color scheme toggle in the first place. ThensetColorScheme
is never called.If have explicitly used
CMS.settings.pagetree
to test for other settings to be retained. Maybe I need more information: Would you haveCMS.settings
available before and after toggling the color scheme in the toolbar? What doesCMS.API.Helpers.getSettings()
return after the toggle (and is it different fromCMS.settings
)?