Home › Forums › Support › Block element: Updating failed. The response is not a valid JSON response.
- This topic has 7 replies, 2 voices, and was last updated 3 years, 2 months ago by David.
-
AuthorPosts
-
January 27, 2021 at 6:58 am #1635713Kirsty
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!
January 27, 2021 at 7:47 am #1635797DavidStaffCustomer SupportHi there,
which block plugins are you having an issue with ?
January 28, 2021 at 4:00 am #1636734KirstyHi 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
January 28, 2021 at 7:57 am #1637171DavidStaffCustomer SupportI 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 ?January 28, 2021 at 8:43 am #1637232KirstyHi 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
January 28, 2021 at 8:48 am #1637242DavidStaffCustomer SupportOK 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/
January 28, 2021 at 8:53 am #1637246KirstyHi 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?
January 28, 2021 at 12:39 pm #1637453DavidStaffCustomer SupportTheir 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 ? -
AuthorPosts
- You must be logged in to reply to this topic.