Skip Navigation

[Resolved] "502 Bad Gateway" and other errors when Toolset is activated

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 1 year, 3 months ago.

Assisted by: Nigel.

Author
Posts
#2679707
toolset-error-1.jpg

I am trying to: Update our theme and plugins on our Flywheel staging site

Link to a page where the issue can be seen: hidden link

I expected to see: A working edit screen

Instead, I got: An error on every post or page edit screen and multiple errors throughout the WP admin.

We’re receiving a combination of "502 Bad Gateway nginx" and “There has been a critical error on this website.” error messages. These appear randomly on all of the WP admin pages, and those pages have to be reloaded over and over again before the page loads. The other main error appears on every post or page edit screen: "Failed to initialize plugin: wpv_add_views_conditional_button". That one is consistent every time, unlike the other errors, so I think that would be the one to focus on first.

Here is what I've learned through troubleshooting: Toolset seems to work without these errors if 1) I deactivate WP Bakery, or 2) I switch from our Porto child theme to a default theme. I have updated WP Bakery and the Porto theme to their latest versions, and the Toolset errors seemed to start with one of those updates. The website works fine with both WP Bakery and Porto if I deactivate Toolset, so this seems to be a Toolset problem. We just purchased a registered version of Toolset and updated our two active Toolset plugins, Toolset Blocks and Toolset Types, but that didn't fix the problem.

Please reply to me directly at ginny@ginnyweaver.com

Thanks,
Ginny Weaver

#2679774

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Ginny

I did some routine testing on your site. It does appear that the Porto theme is currently not compatible with Toolset, the problems you are experiencing only occur with the Porto theme active (either the parent theme or your child theme), and not with a default theme.

I've created a test site locally. I had problems activating the Porto theme when Toolset Blocks was already active, and when I was able to, I saw similar issues on the page edit screens.

So I can investigate further on my local site to see what we can do on our end to identify the source of the conflict and hopefully remedy it.

I'll get back to you.

(I don't have a way to redirect these replies to an email address other than the address the account is registered to.)

#2679863

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

The problems appear to be related to the initialisation of the tinyMCE editor on the post edit screens when using the Classic editor. (It's not applicable when using the block editor.)

I've gathered all the details and raised this with the developers.

I'll get back to you when I have some feedback from them.

#2680855

Hi Nigel,

Thanks for looking into this for us. Have your developers come up with any solutions yet? We need to know soon whether Toolset will still work with our website or whether we need to rebuild those section using ACF and custom post types.

Thanks, Ginny

#2680961

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Ginny

I'm pleased to say the developers have come back having identified the problem.

For some reason the Porto theme itself disables a Toolset script, and that then triggers the errors on the page editing screen.

If you edit the theme functions.php you'll find these lines near the end (around line 1297):

	if ( defined( 'WPB_VC_VERSION' ) && ( defined( 'TYPES_VERSION' ) || defined( 'WPV_VERSION' ) ) ) {
		wp_dequeue_script( 'toolset-codemirror-script' );
		wp_deregister_script( 'toolset-codemirror-script' );
	}

Comment out or delete those lines and there will be no more errors.

You might want to contact the theme authors to request they remove those lines, otherwise any changes will be overwritten when you update the theme.

Alternatively, you can disable part of the Toolset functionality that depends on the Toolset script they remove, which adds Toolset buttons to the post editor (when using the classic editor, rather than blocks).

In which case you would add the following lines (as a snippet at Toolset > Settings > Custom Code, for example):

add_filter( 'toolset_editor_add_form_buttons', '__return_false' );
add_filter( 'wpv_filter_wpv_disable_conditional_output_quicktag', '__return_true' );
#2681583

Thanks for your help with this! I disabled the part of Toolset that was causing the error, and that seems to have fixed it. I really appreciate the help.

Ginny