Skip Navigation

[Resolved] There was an error during the ajax request…… in layouts

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 26 replies, has 2 voices.

Last updated by Christian Cox 4 years ago.

Assisted by: Christian Cox.

Author
Posts
#1194552

I am trying to:
Save a layout and am getting this error:
There was an error during the ajax request, make sure the data you send are in json format.

#1195046

Hi, can you try these troubleshooting steps first?
- Temporarily deactivate all plugins except Types, Views and Layouts and activate a default theme like Twenty Seventeen.
- Clear your browser cache and test again. If the problem is resolved, reactivate your theme, then other plugins, one by one clearing your cache and testing each time until the problem returns.
- Open your browser console and edit the Layout again. Check to see if any error messages appear in the browser console, and copy + paste them here for me to review.

Let me know what you find out and we can go from there.

#1195532

Hi,

It appears related to The Grid plugin. As soon as I activated that I got the error again. I did update the Grid to the latest and that did not help.

Strangely, I have another site with the same setup and am not having the same issue.

Below I pasted error from console

/wp-admin/admin-ajax.php:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:4 POST hidden link 500 (Internal Server Error)
send @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:4
ajax @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:4
e.ajax @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
e.sync @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
sync @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
save @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
saveViaAjax @ LayoutView.js?ver=2.5.2:582
saveLayout @ LayoutView.js?ver=2.5.2:566
_ @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
m @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
f @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
u.trigger @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:61
(anonymous) @ LayoutView.js?ver=2.5.2:431
dispatch @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:3
r.handle @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:3

#1195632

We can try to get more information about the error by turning on server logs. If you're not familiar with server logs I can show you how to activate them temporarily. Go in your wp-config.php file and look for

define('WP_DEBUG', false);

Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Try to save the Layout again. This should create an error_log.txt file in your site's root directory. Please send me its contents.

#1195643

How do I upload a txt doc?

#1195685

You can just open the file, copy its contents, and paste them in your next reply. Otherwise, you can upload the document to Drive or Dropbox or some other legitimate file sharing service, then post a download link here. URLs are obscured from other visitors so it will remain confidential here in the forum.

#1195689

Okay, here is the link:
hidden link

Thanks

#1196147

Got it thanks, I can see the "KILLED QUERY" error description and I am fairly sure that's the main problem here. Can you create a database dump file so I can replicate this problem for my 2nd tier team? You may be able to do this from your host's control panel, or you may need their assistance. Error for reference:

KILLED QUERY (33133 characters long generated in /path/to/wp-content/plugins/layouts/classes-auto/wpddl.post-types-manager.class.php:625)
#1196148

Actually, before you do that let's try this. I found this in a relevant post:
https://searchwp.com/docs/kb/attention-wp-engine-customers-no-results-long-query-killed-query-notices/

"To prevent LONG QUERY and KILLED QUERY limitations in WPEngine, you can add the following to your wp-config.php between # WP Engine Settings and # That’s It. Pencils down:"

define( 'WPE_GOVERNOR', false );

If that doesn't work, please send the database dump file download link.

#1196150

Do you just need the database or the entire site?

You don't think that it has to do with this?:
[04-Feb-2019 21:12:04 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function The_Grid_Admin::delete_transient_on_save(), 2 passed and exactly 3 expected in /nas/content/staging/concordportal/wp-content/plugins/the-grid/backend/admin-init.php:184
Stack trace:
#0 [internal function]: The_Grid_Admin->delete_transient_on_save(36183, Object(WP_Post))
#1 /nas/content/staging/concordportal/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array)
#2 /nas/content/staging/concordportal/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(false, Array)
#3 /nas/content/staging/concordportal/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#4 /nas/content/staging/concordportal/wp-content/plugins/layouts/classes-auto/wpddl.layouts-editor.class.php(396): do_action('save_post', 36183, Object(WP_Post))
#5 /nas/content/staging/concordportal/wp-content/plugins/layouts/classes-auto/wpddl.layouts-editor.class.php(408): WPDD_Layouts_Editor->clear_page_caches(2400)
#6 [internal function]: WPDD_Layouts_Editor->settings_save_ in /nas/content/staging/concordportal/wp-content/plugins/the-grid/backend/admin-init.php on line 184

#1196153

That line was already in there.

Here is link to database dump:

hidden link

#1196334

It certainly could have something to do with that Fatal Error thrown by The Grid. I was hoping I could replicate the problem with just the database (I have older copies of Pro and The Grid), but I was able to save every Layout successfully in my local tests. I think the next step is for you to zip up copies of your parent and child theme, as well as the Grid plugin in use on your site. I'll download those so I know we're working on the same systems.

Also, does this only happen for one specific Layout, or is the problem occurring for other Layouts as well?

#1196354

Hi,

It happens on all layouts.

Here is link to the site.

hidden link

Thanks

#1196785

Checking your settings, I can see this in your config file:

define('WP_GOVERNOR', false);

That's not exactly what was recommended:

define( 'WPE_GOVERNOR', false );

When I install the site locally, I am seeing a different error in the browser console when I edit a Layout:

admin-shortcode.js?wp-mce-4800-20180716:18 Uncaught ReferenceError: tg_names is not defined
    at new <anonymous> (admin-shortcode.js?wp-mce-4800-20180716:18)
    at dx (tinymce.min.js?ver=4800-20180716:2)
    at Array.<anonymous> (tinymce.min.js?ver=4800-20180716:2)
    at Object.qt [as each] (tinymce.min.js?ver=4800-20180716:2)
    at vx (tinymce.min.js?ver=4800-20180716:2)
    at Hx.<anonymous> (tinymce.min.js?ver=4800-20180716:2)
    at Array.<anonymous> (tinymce.min.js?ver=4800-20180716:2)
    at qt (tinymce.min.js?ver=4800-20180716:2)
    at s (tinymce.min.js?ver=4800-20180716:2)
    at n (tinymce.min.js?ver=4800-20180716:2)

If I try to add a Visual Editor cell, that produces another error:
[php]
plugin.min.js?wp-mce-4800-20180716:1 Uncaught TypeError: Cannot read property 'getNode' of undefined
at Hx.<anonymous> (plugin.min.js?wp-mce-4800-20180716:1)
at jg.c.fire (tinymce.min.js?ver=4800-20180716:2)
at Hx.fire (tinymce.min.js?ver=4800-20180716:2)
at Ox (tinymce.min.js?ver=4800-20180716:2)
at Hx.setContent (tinymce.min.js?ver=4800-20180716:2)
at text-cell.js?ver=2.5.2:331
at load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,utils,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,jquery-u&load[]=i-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,quicktags,jquery-ui-tabs,suggest,shortcode,&load[]=wp-util,wp-pointer,wp-a11y,wplink,thickbox,media-upload&ver=4.9.9:59

However, if I delete a cell instead of trying to add a cell, then I am able to save the Layout changes. So there seems to be several different things going on here. Do you see the same error message with only Types, Views, Layouts, and The Grid active?

#1196810
Screen Shot 2019-02-06 at 10.22.02 AM.png
Screen Shot 2019-02-06 at 10.22.18 AM.png

Hi,

Sorry I missed that - define( 'WPE_GOVERNOR', false ); - I have added it now and having same issue, also same issue with just the types plugins and the grid active.

Interestingly though after adding the define( 'WPE_GOVERNOR', false ); an error message that was on the layouts forever has gone away, see attached screen shots.

I have also ran the debug log again and is below:

[06-Feb-2019 16:40:34 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:34 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:37 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:37 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:37 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:37 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:41 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:41 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:45 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:45 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:48 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:48 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:57 UTC] PHP Notice: Undefined index: WP_Widget_Recent_Comments in /nas/content/staging/concordportal/wp-content/themes/pro/framework/functions/setup.php on line 213
[06-Feb-2019 16:40:57 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /nas/content/staging/concordportal/wp-content/plugins/tco-google-analytics/functions/options.php on line 50
[06-Feb-2019 16:40:58 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function The_Grid_Admin::delete_transient_on_save(), 2 passed and exactly 3 expected in /nas/content/staging/concordportal/wp-content/plugins/the-grid/backend/admin-init.php:184
Stack trace:
#0 [internal function]: The_Grid_Admin->delete_transient_on_save(36183, Object(WP_Post))
#1 /nas/content/staging/concordportal/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array)
#2 /nas/content/staging/concordportal/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(false, Array)
#3 /nas/content/staging/concordportal/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#4 /nas/content/staging/concordportal/wp-content/plugins/layouts/classes-auto/wpddl.layouts-editor.class.php(396): do_action('save_post', 36183, Object(WP_Post))
#5 /nas/content/staging/concordportal/wp-content/plugins/layouts/classes-auto/wpddl.layouts-editor.class.php(408): WPDD_Layouts_Editor->clear_page_caches(2400)
#6 [internal function]: WPDD_Layouts_Editor->settings_save_ in /nas/content/staging/concordportal/wp-content/plugins/the-grid/backend/admin-init.php on line 184

Thanks
Chris

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.