You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Config panel's ecosystem does not handle correctly the number sign (#), most likely due to the fact it is considered as the comment sign within transitional YAML output (good guess from @alexAubin).
1. Custom getters
When a custom getter (defined in app package's config script) returns a string containing a hashtag, the YAML configuration generated using this helper discards everything from the # sign.
Typically, fontcompare_ynh has a config panel containing 2 color pickers. Color pickers' values are HTML color codes (e.g: #cccccc). If we pick a different color than default and click save in the Webadmin, the config panel still shows default color.
Running yunohost app config get fontcompare --full --debug shows in particular background_color: None (would the string be test#AB, YAML config would only take into account test...)
Or maybe in Moulinette's read_yaml function, but it looked more complicated to me.
2. Others ?
I wonder whether this issue can impact other parts of the code as well. I noticed for instance that in element_ynh's config panel, when changing the "Brand text" input box from default Element to:
Describe the bug
Config panel's ecosystem does not handle correctly the number sign (
#
), most likely due to the fact it is considered as the comment sign within transitional YAML output (good guess from @alexAubin).1. Custom getters
When a custom getter (defined in app package's
config
script) returns a string containing a hashtag, the YAML configuration generated using this helper discards everything from the#
sign.Typically, fontcompare_ynh has a config panel containing 2 color pickers. Color pickers' values are HTML color codes (e.g:
#cccccc
). If we pick a different color than default and click save in the Webadmin, the config panel still shows default color.Running
yunohost app config get fontcompare --full --debug
shows in particularbackground_color: None
(would the string betest#AB
, YAML config would only take into accounttest
...)The issue originates in
read_yaml
as defined in Moulinette's filesystem.py, which is called in app.py via hook.py.To solve this, we need the values to be between quotes when passed in
read_yaml
It can be fixed either:
echo "\"$my_return_string\""
yunohost/helpers/helpers.v2.1.d/config
: Fix yaml hashtag handling from config panel's custom getter yunohost#2016read_yaml
function, but it looked more complicated to me.2. Others ?
I wonder whether this issue can impact other parts of the code as well. I noticed for instance that in element_ynh's config panel, when changing the "Brand text" input box from default
Element
to:Elementab
, then after saveElementab
is displayedElementab save related log
Elementab#hello
, then after save onlyElementab
is displayedElement#ab save related log
It shows there might be a similar issue with
ynh_app_setting set
Context
The text was updated successfully, but these errors were encountered: