Fix #701 Preferable default theme
#746
Zusammengeführt
KitaitiMakoto
hat 3 Commits von preferred-default-theme
nach master
vor 4 Jahren zusammengeführt
Laden…
In neuem Issue referenzieren
Hier gibt es bis jetzt noch keinen Inhalt.
Branch „preferred-default-theme“ löschen
Das Löschen eines Branches ist permanent. Es KANN NICHT rückgängig gemacht werden. Fortfahren?
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 ~expecting~ assuming that this workaround wasn't needed anymore.
Ah, sorry, I missed your point.
Yes, your realization is correct.
Reviewer
b834d1c282
gemergt.Schritt 1:
Wechsle auf einen neuen Branch in deinem lokalen Repository und teste die Änderungen.Schritt 2:
Führe die Änderungen zusammen und aktualisiere den Stand online auf Forgejo.