Problem/Motivation
When adding custom settings to the formatter, the moment you add a nested json, you aren't able to save the settings.
You get the error "The custom settings are not a valid JSON object."
When you add the needed nested settings directly to the config file of your view mode, the settings work correctly, but you can't resave the settings in the UI, throwing the same error.
Steps to reproduce
- Add custom settings to a field using the lightGallery Thumbnails formatter
- Example of a nested json:
-
{ "counter": true, "download": true, "getCaptionFromTitleOrAlt": false, "hideScrollbar": true, "thumbMargin": 8, "thumbHeight": "92px", "thumbWidth": 92, "mobileSettings": { "controls": false, "download": false, "showCloseIcon": true } } - You aren't able to save the settings.
- Add the needed nested settings directly to the config file of your view mode.
- Example of the nested settings:
-
custom_settings: counter: true download: true getCaptionFromTitleOrAlt: false hideScrollbar: true thumbMargin: 8 thumbHeight: 92px thumbWidth: 92 mobileSettings: controls: false download: false showCloseIcon: true - Validate that the nested settings are working correctly in the frontend
- Go back to the settings on your view mode and try to resave
Comments
Comment #3
matthijsIssue was caused by the maximum depth setting. I bumped this to 3 and release 2.0.3