JS code update needed for sweetalert2
-
If the plugin is used together with another plugin (in my case, WP Cloudflare Super Page Cache) which uses a newer version of the ‘sweetalert2’ js library (11.0.18 for the mentioned plugin), WP htaccess editor won’t be able to Save or Save Test anymore, but it will throw the following JS errors:
wp-htaccess-editor.js?ver=1.70:formatted:32 Uncaught TypeError: Class constructor rn cannot be invoked without 'new' at block_ui (wp-htaccess-editor.js?ver=1.70:formatted:32) at HTMLAnchorElement.<anonymous> (wp-htaccess-editor.js?ver=1.70:formatted:171) at HTMLAnchorElement.dispatch (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,hoverIntent,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.2:2) at HTMLAnchorElement.v.handle (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,hoverIntent,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.2:2)A quick fix for this would be to use object instantiation with
newin all the places where there is none currently, i.e.tmp = new swal(instead oftmp = swal(. It might be also a matter of file/module import, I’m not sure about this.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘JS code update needed for sweetalert2’ is closed to new replies.