Bug #12191
closedArray-typed smart parameters changed to broken JSON
Description
I have a smart parameter of type array.
I set the value to a dashed list (of package names in my case) like this:
- puppet3
- facter2
- nginx-custom-dev
I can enter this without any problems, but when I want to update the value (e.g. add a new entry), this list will be presented like this:
"- puppet3\r\n- facter2\r\n- nginx-custom-dev"
Confirming the change (even if you haven't changed anything at all) will store the value as a string.
Entering the list as JSON results in a similar problem:
["puppet3", "facter2", "nginx-custom-dev"] will be turned into "[\"puppet3\", \"facter2\", \"nginx-custom-dev\"]"
So the list value will be turned into a string. Editing and saving a node with such a parameter will wrap the string again everytime it's saved, adding more quotes and escaping blackslashes.
Expected behavior:
Obviously preserving the original representation of the value or at least a compatible and valid representation.
Updated by Anonymous over 9 years ago
- Is duplicate of Bug #11375: Smart class parameters turn YAML to string when using a multi line yaml added
Updated by Anonymous over 9 years ago
- Category changed from Web Interface to Parameters
- Status changed from New to Duplicate
- Difficulty deleted (
easy)