Conditional logic 1.6.1 - JavaScript Error
Support › MB Conditional Logic › Conditional logic 1.6.1 - JavaScript ErrorResolved
- This topic has 4 replies, 2 voices, and was last updated 6 years, 5 months ago by
FED.
-
AuthorPosts
-
November 8, 2018 at 12:23 AM #11879
FED
ParticipantHello, first I'd like to start by saying I am super excited about these speed improvements.
However, upon updating, I now get the following JS error in the console (as an aside, the version number of the js file still reflects version 1.5 in the PHP).
Uncaught TypeError: $field.closest is not a function
at getFieldScope (conditional-logic.js?ver=1.5:265)
at conditional-logic.js?ver=1.5:211
at Array.forEach (<anonymous>)
at isLogicCorrect (conditional-logic.js?ver=1.5:200)
at Object.<anonymous> (conditional-logic.js?ver=1.5:308)
at Function.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.8:2)
at Object.<anonymous> (conditional-logic.js?ver=1.5:301)
at Function.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.8:2)
at runConditionalLogic (conditional-logic.js?ver=1.5:300)
at init (conditional-logic.js?ver=1.5:513)
<code></code>Which is referring to this block of code:
function getFieldScope( $field ) {
// If the current field is in a group clone, then all the logics must be within this group.
var $groupClone = $field.closest( '.rwmb-group-clone' );
if ( $groupClone.length ) {
return $groupClone;
}
// Global scope.
return '';
}
<code></code>I haven't had a chance to dig deeper into that yet, but it is breaking the clonability of my metaboxes in almost every location where they are used.
Thanks!
November 8, 2018 at 10:47 AM #11887Anh Tran
KeymasterHi FED,
Thanks for your feedback. I've just fixed it and released new version. Can you please try again?
November 9, 2018 at 9:41 PM #11909FED
ParticipantThanks! Now it seems my nested conditionals aren't behaving, but cloning is much faster!!
This is the console error:
conditional-logic.js?ver=1.5:342 Uncaught TypeError: conditions.forEach is not a function at getWatchedElements (conditional-logic.js?ver=1.5:342) at init (conditional-logic.js?ver=1.5:521) at conditional-logic.js?ver=1.5:528 at dispatch (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.9.8:3) at r.handle (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.9.8:3)
Referring to this block:
// Outside conditions. conditions.forEach( function ( logics ) { logics.forEach( function ( logic ) { if ( typeof logic.when === 'undefined' ) { return; } logic.when.forEach( addWatchedElement, null ); } ); } );
November 12, 2018 at 4:06 PM #11916Anh Tran
KeymasterHi,
I've fixed this bug in the version 1.6.3 and updated the Conditional Logic extension. I'm waiting for a fix for the Builder, then AIO will be updated.
November 16, 2018 at 12:53 AM #11964FED
ParticipantThank you!!
-
AuthorPosts
- You must be logged in to reply to this topic.