ReCaptcha does not work in Mendix version 7.5.1 (and 6.10.9)

1
I am upgrading my Mendix project from 5.21.1 via 6.10.9 to 7.5.1. Fixed all issues, except the imported Synobsys ReCaptcha Module. At runtime the text "ReCaptcha placeholder" appears in stead of the Captcha itself. In Mendix 5.21.1 it worked, but in 6.10.9 and 7.5.1 it doesn't. I tried the obvious stuff like "update all widgets" but no result. I tested in the cloud (not local). Anyone who had the same problem?  
asked
2 answers
0

Did you raise an issue on Github? (https://github.com/synobsys/mendix-ReCaptcha)

Regards,

Ronald

answered
0

In the console in the browser is see this:


mxui.js?636433354971055256:5 mxui_widget_DataView_3.destroy: Unable to destroy:ReCaptcha_ReCaptchaWidget_ReCaptchaWidget_1.uninitialize: TypeError: Cannot read property 'remove' of null
error @ mxui.js?636433354971055256:5
(anonymous) @ mxui.js?636433354971055256:5
forEach @ mxui.js?636433354971055256:5
t.exports.destroyWidgetsIn @ mxui.js?636433354971055256:5
destroy @ mxui.js?636433354971055256:15
(anonymous) @ mxui.js?636433354971055256:15
a @ mxui.js?636433354971055256:5
(anonymous) @ mxui.js?636433354971055256:15
_fire @ mxui.js?636433354971055256:5
_cycle @ mxui.js?636433354971055256:5
(anonymous) @ mxui.js?636433354971055256:5
a @ mxui.js?636433354971055256:5
(anonymous) @ mxui.js?636433354971055256:5

 

 

In the source the error is located in the bold code line:

 

             * Called upon completion of the microflow
             * Create the ReCaptcha
             *
             * @param resultArray
             */
            configurationMicroflowCallback: function (resultArray) {

                var reCaptchaCreateArgs;

                if (resultArray === "") {
                    console.log("No Recaptcha configuration found");
                    return;
                }
                this.configurationObject = resultArray[0];
                if (this.buttonIcon === 'not-set') {
                    this.buttonIcon = null;
                }
                try {
                    this.submitButton = new mendix.widget._Button({
                        caption: this.caption,
                        icon: this.buttonIcon,
                        type: this.showAsButton.toLowerCase(),
                        cssclass: "recaptcha-button"
                    });
                    this.buttonOnClickHandle = on(this.submitButton.domNode, 'click', lang.hitch(this, this.onButtonClick));
                } catch (e) {
                    console.error("Button render exception: " + e);
                    return;
                }

                this.domNode.appendChild(this.submitButton.domNode);

                reCaptchaCreateArgs = {theme: this.theme};
                if (this.focusRecaptchaInput) {
                    reCaptchaCreateArgs.callback = Recaptcha.focus_response_field;
                }

                Recaptcha.create(this.configurationObject.get(this.publicKeyAttr), 'captchadiv', reCaptchaCreateArgs);

            },

  

answered