• Running WooCommerce, created the custom 2FA page as per setup instructions. Page loads fine, but upon clicking “Configure 2FA” a JavaScript error occurs:

    Uncaught TypeError: this.modal is null
        value https://dev.academicimpressions.com/wp-content/plugins/wp-2fa/dist/js/micro-modal.js?ver=1.5.1:1
        show https://dev.academicimpressions.com/wp-content/plugins/wp-2fa/dist/js/micro-modal.js?ver=1.5.1:1
        <anonymous> https://dev.academicimpressions.com/wp-content/plugins/wp-2fa/dist/js/wp-2fa.js?ver=1.5.1:1
        jQuery 10
    micro-modal.js:1:21128

    Page normally uses jQuery 1.12.4, have also tried 3.5.1, same behavior.

    Any ideas on how to go about fixing this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter knnthai

    (@knnthai)

    Worked out a fix for this for my situation, YMMV.

    Error is originating here: micro-modal.js:1:23499: show:function(t,n){var e=n||{};e.targetModal=t,!0===e.debugMode&&!1===i(t)||(o&&o.removeEventListeners(),(o=new r(e)).showModal())},

    o.removeEventListeners() appears to be the culprit, as this.modal isn’t visible in that function. Removing that o check,

    show: function (t, n) {
        var e = n || {};
        (e.targetModal = t), (!0 === e.debugMode && !1 === i(t)), (o = new r(e)).showModal();
    },

    Allows the modal to be shown. This could potentially pose problems if o is reused elsewhere, as it doesn’t remove any existing event listeners. Haven’t had any issues yet in testing, but again, YMMV 🙂

    Danny Jones

    (@distinctivepixels)

    Hello @knnthai

    Thanks for getting in touch.

    Iv just tested the custom 2FA page with WC installed and running just WP 2FA + WooCommerce (with the current version of WP) doesn’t appear to have any issues here. Id like to keep digging however so can you please send us an email on [email protected] so we can ask you for more information to start troubleshooting this issue?

    Look forward to hearing from you

    Daniel @ WP White Security

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom page Configure 2FA button error’ is closed to new replies.