Thursday, 27 September 2018

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 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.
1234567891011121314
changeHandler = function(e) {var caller;void 0 === (caller = $(e.target).data("vc.accordion")).getRelatedTab && (caller.getRelatedTab = function() {var findTargets;return findTargets = function() {return caller.getContainer().find("[data-vc-tabs]").filter(function() {var $this;return void 0 === ($this = $(this)).data("vc.accordion") && $this.vcAccordion(), $this.data("vc.accordion").getSelector() === caller.getSelector()})}, caller.isCacheUsed() ? (void 0 === caller.relatedTab && (caller.relatedTab
Source: https://managewp.org/articles/17917/wpbakery-visual-composer-bug-in-change-handler



source https://williechiu40.wordpress.com/2018/09/27/wpbakery-visual-composer-bug-in-change-handler/

No comments:

Post a Comment