• Resolved mihai01

    (@mihai01)


    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 new in all the places where there is none currently, i.e. tmp = new swal( instead of tmp = swal(. It might be also a matter of file/module import, I’m not sure about this.

Viewing 1 replies (of 1 total)
  • Plugin Author WebFactory

    (@webfactory)

    I’ll look into this. But just from reading what you said I don’t see a reason why Cloudflare (or any other plugin) would need to load its JS on our page. That would mean it loads its JS on every single WP admin page which is a bad practice, to say the least. But, maybe it’s not that, I’ll have a look. And yes, we probably do need to put a new version of SWAL in 🙂

Viewing 1 replies (of 1 total)

The topic ‘JS code update needed for sweetalert2’ is closed to new replies.