WPBakery (Visual Composer) Bug in Change Handler

The WPBakery (Visual Composer) changeHandler function uses the “vc.accordion” data attribute without first checking for it’s existence.

Any plugin or theme using a jQuery show / hide event trigger (for example) will trip this bug, and the post editing page will fail to load properly.

I’ve posted the bug report to the Visual Composer channel on Slack, but the channel does not seem to be read by WPBakery employees, so this bug may continue to go unfixed.

The unminified WPBakery code looks like this. Note that data("vc.accordion") is being used here without first checking if the attribute exists or not.

There are many examples of jQuery code to trigger a show / hide event – here are two popular jQuery examples that will trip the WPBakery change handler bug. Other types of jQuery event handlers (click, hover, etc.) may also trip this bug, but I’ve only tested the jQuery show / hide events.