[Support request] Block element: Updating failed. The response is not a valid JSON response.

Home Forums Support [Support request] Block element: Updating failed. The response is not a valid JSON response.

Home Forums Support Block element: Updating failed. The response is not a valid JSON response.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1635713
    Kirsty

    I am trying to use the Block Element but every time I try to save I get this message:

    Updating failed. The response is not a valid JSON response.

    This only happens when I try to use third party blocks. I note in the GeneratePress documentation it says that third party blocks may not style correctly, but nothing about elements failing to save at all if you use them.

    There are some design elements (tabs and accordions) that I absolutely need, that are not available in GenerateBlocks or standard Gutenberg. If the third party blocks are the cause of this problem, do you have any recommendations that will work with elements to extend the range of block options?

    Many thanks!

    #1635797
    David
    Staff
    Customer Support

    Hi there,

    which block plugins are you having an issue with ?

    #1636734
    Kirsty

    Hi David,

    I am using the Gutentor plugin. I am specifically trying to use their tabs and accordion blocks, but any Gutentor blocks seem to trigger this problem.

    If I use standard bocks or GenerateBlocks, then the element saves and works correctly.

    I am happy to try other third party block plugins if there are others known to work more successfully, but the Gutentor accordion is most flexible I have found, so would like to stick with that if I can.

    Many thanks,

    Kirsty

    #1637171
    David
    Staff
    Customer Support

    I am not able to replicate the issue on my test install…
    What content are you using in the Accordion / Tab Elements ? Are there any shortcodes inside them ?

    #1637232
    Kirsty

    Hi David,

    I am using acf shortcodes on the same element. I am not using these inside the tab or accordion blocks at the moment (but I do want to do this). One of those acf shortcodes sits inside some HTML.

    I have just tried creating a new block element without the acf shortcodes, and that seems to be fine with the Gutenator blocks.

    I have also tried using an acf shortcode inside a Gutenator block without the HTML and that works too, so it looks like the problem is putting the acf shortcode inside an HTML tag, in combination with using Gutenator. I might be able to work around this!

    Does that help?

    Many thanks,

    Kirsty

    #1637242
    David
    Staff
    Customer Support

    OK the JSON error is commonly generated if the Shortcode is echoing its content without Output Buffering.

    Heres an example of a shortcode that use Output Buffering that should fix the issue:

    https://docs.generatepress.com/article/creating-a-shortcode/

    #1637246
    Kirsty

    Hi David,

    Sorry, I’m not really clear how to use this?

    I am also finding that I get the JSON error if I edit any of the settings for the Gutenator blocks (without acf shortcodes in play).

    Many thanks,

    Kirsty

    EDIT: Of course, the settings don’t appear on the site anyway due to the CSS limitation. I don’t suppose there is any way round this or any third party plugins where the styling does work in elements?

    #1637453
    David
    Staff
    Customer Support

    Their isn’t anything we can currently do with the CSS not being generated at this time. Its down to how the Block Plugins generate their CSS thats the issue.

    Generally the JSON error is shortcode related.
    How was the shortcode created ? Was it hand coded ? If so can you share it here so i can see if theirs an issue ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.