_ undefined variable; missing library; causes Yoast SEO to break
-
Using version 1.10, I get a javascript error that _ variable is undefined which comes from lib/class-option-number.php (line 123).
Seems it’s using the _ variable, but it’s undefined. This causes my Yoast SEO plugin to break. I can’t edit the Titles & Metas settings in the admin.
New behavior with 1.10. Did not happen with 1.9.x and prior.
Specific to using a number field.
Offending code in lib/class-option-number.php (line 123):
$( ‘.tf-number input[type=number]’ ).on( ‘keyup’, _.debounce( function() {
if ( $( this ).prev().slider( ‘value’ ).toString() !== $( this ).val().toString() ) {
$( this ).prev().slider( ‘value’, $( this ).val() );
}
}, 500 ) );I had to install the underscore.js library from underscorejs.org and that defined _ and _.debounce().
It seems version 1.10 code was developed with this or a similar library, but that library is not included anywhere in the code.
1.9.x and before didn’t have this code, it’s new to 1.10. Options are to remove the _.debounce function that wraps the anonymous function or install a library that defines _ variable and the debounce function.
Any word on when titan will either change/fix this code or include the necessary library?
- The topic ‘_ undefined variable; missing library; causes Yoast SEO to break’ is closed to new replies.