I am trying to:
- Save changes to a Toolset Layout.
Link to a page where the issue can be seen:
- N/A, the problem is on the admin backend.
I expected to see:
- My changes saved.
Instead, I got:
- This error:
"There was an error during the ajax request, make sure the data you send are in json format."
Hi, this could indicate a conflict with another plugin or theme. Can you try these troubleshooting steps first?
- Temporarily deactivate all plugins except Types, Views and Layouts, and activate a default theme like Twenty Nineteen. If you need to activate maintenance mode using a plugin that's fine.
- Make sure you're using the latest versions of Toolset plugins. Update if necessary.
- Clear your browser cache and test again. If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem is not resolved by deactivating all other plugins and themes, continue to the next steps.
- Open the browser console and check for any JavaScript errors that appear when you try to edit the Layout. Copy + paste those here for me to review.
- Is your site hosted on WP Engine? There is currently an issue with specific types of caching on their system.
Hi! Thanks for this reply.
This site has a lot of plugins, so it will take some time to debug that.
In the meantime, I checked for errors when I try to save a layout, and this Javascript error comes up:
Failed to load resource: the server responded with a status of 500 ()
/wp-admin/admin-ajax.php?_fs_blog_admin=true
Does this mean the page somehow doesn't know I'm logged in as admin? I am definitely logged in as admin, since I'm accessing the layout editing page.
This might be helpful: in an effort to reduce CPU load, one of our tech people added this code to our functions.php:
remove_action( 'wp_enqueue_scripts', 'ref_enqueue_customizer_css', 100 );
remove_action( 'wp_ajax_ref_dynamic_css', 'ref_dynamic_css' );
remove_action( 'wp_ajax_nopriv_ref_dynamic_css', 'ref_dynamic_css' );
Could any of these be affecting this issue?
Our site is not hosted on WPEngine. But it is hosted on Siteground, and I think the tech people might be using as aggressive caching from Siteground. We also use Cloudflare, although I don't think would affect admin pages. Have you had any issues with Siteground or Cloudflare?
Does this mean the page somehow doesn't know I'm logged in as admin?
No, most likely that's unrelated. An error code 500 on admin-ajax.php may refer to any generic server-side error, not necessarily something related to user role or login state.
This might be helpful: in an effort to reduce CPU load, one of our tech people added this code to our functions.php
I can't tell from the code you have included here whether or not these actions are part of the problem. Switching to a default theme temporarily might be a simple way to eliminate that as the source, if the problem remains after switching.
Have you had any issues with Siteground or Cloudflare?
I'm aware of one issue with memcached, specific to Siteground / SG Optimizer, that will be addressed in the upcoming Types 3.3 release. Here's a link to that ticket: https://toolset.com/forums/topic/memcached-prevents-field-group-title-from-saving/
I'm not aware of any open issues with Cloudflare. Most of the time CDN issues can be resolved by purging caches and excluding Toolset files from minification.
Thanks for these notes!
I tried disabling all the plugins except Toolset on a staging site. This does allow me to edit the Toolset Layout. I'm not sure which plugin is the problem, but by disabling them all, I was able to make this change, then enable the plugins again.
Thanks!
Okay that indicates a conflict with another plugin or combination of plugins. By reactivating them one by one, or in large groups, testing each time, you should be able to eventually pin down which plugins are the source of the conflict. Once you determine that, I can try to replicate the same issue locally by installing the same plugin. If it's replicable, our compatibility team can try to collaborate with the plugin's authors to come up with a solution. If it's not replicable, I'll have to do some more in-depth investigation, preferably on your staging site or a copy of the staging site.
Thanks, Christian! I'm not sure the client will want me to hunt this down like that or share a staging copy, but I appreciate that you all would want to debug this.
I'm fairly certain that Beaver Builder is involved, because that was the last plugin I needed to deactivate in order for the save to work. I don't know whether using Beaver Builder and Toolset on the same site is even quite legitimate (especially now that Gutenberg is here), but they do seem to serve different use cases.
One other note in case anyone else finds this thread: after I reactivated all the plugins, the client noticed that all custom types with Toolset Types were throwing a 404 "page not found". It turned out that the URLs for custom post types weren't loading. The solution was to clear the site cache; since we're on Siteground, that meant clicking "Purge SG Cache," but it would be different on other systems.
I am hoping that future plugin updates will quietly fix this, but I may revisit this thread in the future if we need to make more extensive layout edits and we're still getting this error.
thanks!
Beaver Builder and Layouts should not be used together, but other Toolset suite features are compatible with BB. Check our best practices documentation here: https://toolset.com/documentation/user-guides/using-toolset-with-beaver-builder/
Thanks for the link! Hmm, that is interesting that you advise against using both Toolset Layouts and Beaver Builder.
On our site, we rely heavily on Layouts to provide a standard layout for each of several custom post types. I don't know any other tool I'd want to use for this, it's one of the main reasons I choose Toolset.
Yet we also sometimes need to create one-off pages with fancy layouts, which is exactly the use case for Beaver Builder.
For these pages, I use a simple Toolset Layout that only includes a standard site footer. But it sounds like you are saying that Beaver Builder should not be used on this site at all, since we rely on Toolset Layout.
What other page builder would you recommend instead, that is comparable with Beaver Builder in features?
Thanks!
What other page builder would you recommend instead, that is comparable with Beaver Builder in features?
We recommend not using any other page builder system if your site uses Toolset Layouts:
https://toolset.com/documentation/user-guides/page-builders/