Closed (fixed)
Project:
Easychart
Version:
4.0.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 Oct 2016 at 18:27 UTC
Updated:
22 Mar 2022 at 09:59 UTC
Jump to comment: Most recent, Most recent file
Submitting a value for Templates (admin/config/media/easychart/templates) other than the default (ie. any JSON) breaks config-export/import.
The error occurs either on a cim, or subsequent cex command:
Drupal\Core\Config\UnsupportedDataTypeConfigException: Invalid data type in config easychart.settings, found [error]
in file/home/vagrant/docroot/web/profiles/mysite_profile/config/sync/easychart.settings.yml : Malformed
inline YAML string ("[{\r\n \"id\": --snip, really long line of json
Using Drupal's Json::encode to store the config string will correct this issue. I think this probably affects Presets as well, but I dont have anything in that setting and this is all I've had time to look into.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | json-config-breaks-config-export-2820545-5.patch | 2.13 KB | juanl |
| #4 | json-config-breaks-config-export-2820545-4.patch | 2.06 KB | petermallett |
| #2 | json-config-breaks-config-export-2820545-2.patch | 2.3 KB | petermallett |
Comments
Comment #2
petermallett commentedThis patch adds form validation to test the JSON submitted and encodes the text using Json::encode before storing the string value into the config system.
This necessitated a json_decode with JSON_PRETTY_PRINT be used with the form default or it was just one long line.
Comment #3
thomas_rz commentedComment #4
petermallett commentedI was trying to make some adjustments to this today and ended up making a simpler patch by factoring out the Json object since this string is never meant to be used as HTML.
Comment #5
juanl commentedpatch #2 updated for version 3.5.0
Comment #7
web-beestComment #8
web-beest