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

rubendello created an issue. See original summary.

  • matthijs committed f77d9c5c on 2.x
    Issue #3561306: Fix maximum depth settings JSON
    
matthijs’s picture

Status: Active » Fixed

Issue was caused by the maximum depth setting. I bumped this to 3 and release 2.0.3

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.