Fix #701 Preferable default theme #746
Nav izskatītāju
Iezīmes
Nav iezīmju
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
Nav atskaites punkta
Nav projektu
Nav atbildīgo
1 dalībnieks
Paziņojumi
Izpildes datums
Nav uzstādīts izpildes datums.
Atkarības
Nav atkarību.
Atsauce: Plume/Plume#746
Notiek ielāde…
Pievienot tabulu
Atsaukties jaunā pieteikumā
Nav sniegts apraksts.
Izdzēst zaru "preferred-default-theme"
Zara izdzēšana ir neatgriezeniska. Kaut arī izdzēstais zars neilgu laiku var turpināt pastāvēt, pirms tas patiešām tiek noņemts, to vairumā gadījumu NEVAR atsaukt. Turpināt?
This patch fixes #701 .
The issue occurs because form value of
email
is empty string""
when user selects "Default theme" and it is set as preferred theme name. There's no theme named""
, so any theme is not applied. By settingNULL
tousers.preferred_theme
when "Default theme" is selected, instance theme is used as the user's preferred theme.I used Diesel's
#[changeset_options(treat_none_as_null="true")]
attribute onUser
model. This may not be preferred butsave_changes
doesn't have option to setNULL
sometimes and keep current value otherwise(See http://diesel.rs/guides/all-about-updates/ . It says "Diesel doesn't currently provide a way to explicitly assign a field to its default value"). This is the reason why I used that attribute, but it may have too wide inpact. Could you consider?Codecov Report
I did a quick check to see if it could impact something else, but it looks like it is safe. Thanks for contributing!
Woops, forgot to approve
Thank you for merging!
Sadly a new user of mine still just ran into missing CSS on 0.5.0 :(
@verymilan Can you re-save configuration again, please?
I am not sure what you mean, but as usual, i have made them selecting a theme and save, which was fixing their issue as always
Sorry for my poor English. What I did mean is...
Can you have your users select "Default theme" and save it? It might be fix the issue?
Under the hood, their current theme is saved as empty string
""
but re-saving theme makes itNULL
. And then default theme is applied.Yes, i know, and this is how we did it - i was just
expectingassuming that this workaround wasn't needed anymore.Ah, sorry, I missed your point.
Yes, your realization is correct.