-
-
Couldn't load subscription status.
- Fork 6.2k
Enhancement: Align gravatar and federated avatar to enable in Admin/Configuration #35685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Enhancement: Align gravatar and federated avatar to enable in Admin/Configuration #35685
Conversation
Frontend still interacts directly with the database entry name `picture.disable_gravatar` so logic needs flipped when writing, but logic to read automatically flips based on config.Invert() being called during init or INI read.
Install now submits the proper database name and is properly set using the config.Value class. This extends the getter functionality so now config.Value can be used to both get and set values.
|
@markbrown87 I noticed you've updated the locales for non-English languages. These will be overwritten during the sync from our translation tool Crowdin. If you'd like to contribute your translations, please visit https://crowdin.com/project/gitea. Please revert the changes done on these files. 🍵 |
Accidental swap of enable_federated_avatar to disable in avatars.tmpl
9efa6e1 to
524dd74
Compare
|
Thank you for the PR. It seems much more complex than I thought (and than it should be ....), and I really worry about the maintainability of this approach. Maybe the "database configuration system" needs a whole re-design to make it flawlessly work with the "ini config". |
|
Thank you wxiaoguang for reviewing this. I agree with you on all points. The best I could hope for would be this approach might set the groundwork for that database configuration system redesign. I would like to do things the right way over temporary patches, but I don't know how pressing such a redesign is compared to other more important features. That said, should I close this and wait for the redesign? Or do you have an idea for another approach, or something I can do to this MR to make it more maintainable? |
|
Let's keep it open. I think it provides very valuable input for the config system redesign. And maybe it will be the groundwork in the future. 🙏 |
Under Admin/Configuration/Settings housed
Disable GravatarandEnable Federated AvatarsThis PR aligns with enable convention
In an attempt to aid future changes from
DISABLE_xxxconfig.Value class was extended to invert booleans and allow forSelectFromoption. TheSelectFrombuild option allows for the underlying database entry to remain the same and thus not have the need to migrate the database to a new entry.To aid in this, a
config::setterclass was created which mirrors theconfig::getterabstraction which can be used to set the value in the database. This consolidates the getting and setting from one sourceconfigand allows for any manipulation that is required during getting and setting of the configuration database value.for completeness, installation has a minor change as well. Here is the before change
And after
Finally, this PR modifies the access values for all the locale but only changes the English locale. Once this PR has progressed to that level, I will submit for a translation to
Enable Gravatarin other languages.Closes #35627