We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54180
    • 11 Posts
    Quote from: dubbs at Mar 05, 2018, 05:10 AM
    So.. for those looking to get quipReply to work with recaptchaV2 do this...

    First install latest version of recaptchaV2 from here - https://modx.com/extras/package/recaptchav2

    Make the changes as described in this comment - https://forums.modx.com/thread/103038/quip-with-recaptcha-v2?page=5#dis-post-557140

    Then adapt your quipReply to read:
    [[!QuipReply? &thread=`article-ARTICLESRESOURCEIDHERE-[[*id]]` &preHooks=`recaptchav2` &closeAfter=`0` &moderate=`1` &requireAuth=`0` &recaptcha=`0` ]]


    Changing the ARTICLESRESOURCEIDHERE to be the resource ID of your resources blog in your site tree.

    Note - you need to make sure you add the:
    [[!recaptchav2_render]]
    <span class="quip-error"> [[!+error.recaptchav2_error]]</span>


    to your Reply Form Chunk.

    Note - this overrides the suggestion in the comment at https://forums.modx.com/thread/103038/quip-with-recaptcha-v2?page=5#dis-post-557140

    Should all work nicely now!

    dubbs.

    Hi Dubbs

    I still can't seem to get this to work with our MODX installation. The steps I have carried out so far are as follows:

    1. Installed RecaptchaV2 2.3.0-rc1

    2. In core/components/quip/processors/web/comment/create.php found:


    $quip->preHooks->loadMultiple($this->getProperty('preHooks',''),$this->getProperties(),array(



    and replaced it with this:

    $quip->preHooks->loadMultiple($this->getProperty('preHooks',''),$fields,array(


    3. Changed the quipReply in resolveQuipComment from:

    [[!QuipReply? &thread=`[[+thread]]` &recaptcha=`1` &tplAddComment=`resolveQuipAddComment` &parent=`[[+id]]` ]]


    to:

    [[!QuipReply? &thread=`article-3-[[*id]]` &preHooks=`recaptchav2` &closeAfter=`0` &moderate=`1` &requireAuth=`0` &recaptcha=`0` ]]


    ("3" being the relevant Resource ID)

    4. In resolveQuipAddComment, changed:

    [[+quip.recaptcha_html]]
    <span class="quip-error">[[+error.recaptcha]]</span>


    to:

    [[!recaptchav2_render]]
    <span class="quip-error"> [[!+error.recaptchav2_error]]</span>



    (NB. as you have most likely noticed, our Quip Chunks have custom names - e.g. resolveQuipAddComment). The v2 form now appears within blog posts, but the page simply refreshes when the form is submitted. If I do not tick the recaptcha box, the form submits / refreshes without error. All comments are moderated, but the comment does not appear in Unapproved Comments in the back-end. I'm not quite sure where I'm going wrong. Any help would be much appreciated.
      • 17301
      • 932 Posts
      Did you delete your core/cache folder and clear cache after editing the static file?
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 54180
        • 11 Posts
        Quote from: lkfranklin at Apr 06, 2018, 08:06 AM
        Did you delete your core/cache folder and clear cache after editing the static file?

        Thanks for the prompt response, LK. So basically, following the changes I should clear everything in core\cache\ (files and folders) and then go to Manage > Clear Cache in MODX? (please bear with me, I've only been using MODX for around two months) smiley
          • 17301
          • 932 Posts
          Yeah it may not be the root cause but its usually a good starting point just to rule it out smiley
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 8168
            • 1,118 Posts
            Also worth making sure your recaptchaV2 is working elsewhere to narrow down issues.. e.g. have you got it working with Formit for example? I assume you have entered the correct secret keys etc for the recaptchaV2 in system settings?
              • 54180
              • 11 Posts
              Quote from: lkfranklin at Apr 06, 2018, 08:48 AM
              Yeah it may not be the root cause but its usually a good starting point just to rule it out smiley

              Thanks for confirming. I've since reverted my original changes so I'll need to make them again then clear the cache. If I get chance this afternoon then I'll post the results here, otherwise it may be Monday before I get round to testing this.
                • 54180
                • 11 Posts
                Quote from: dubbs at Apr 06, 2018, 09:05 AM
                Also worth making sure your recaptchaV2 is working elsewhere to narrow down issues.. e.g. have you got it working with Formit for example? I assume you have entered the correct secret keys etc for the recaptchaV2 in system settings?

                Yes, the secret keys are present and correct. I haven't carried out any other tests with other MODX components, though.
                  • 8168
                  • 1,118 Posts
                  Looks like you are missing your tpl call in your quipReply statement:

                  [[!QuipReply? &thread=`article-3-[[*id]]` &preHooks=`recaptchav2` &closeAfter=`0` &moderate=`1` &requireAuth=`0` &recaptcha=`0` ]]
                  


                  Should be:

                  [[!QuipReply? &thread=`article-3-[[*id]]` &preHooks=`recaptchav2` &closeAfter=`0` &moderate=`1` &requireAuth=`0` &recaptcha=`0` &tplAddComment=`resolveQuipAddComment` ]]
                  
                    • 54180
                    • 11 Posts
                    Quote from: dubbs at Apr 06, 2018, 09:24 AM
                    Looks like you are missing your tpl call in your quipReply statement:

                    [[!QuipReply? &thread=`article-3-[[*id]]` &preHooks=`recaptchav2` &closeAfter=`0` &moderate=`1` &requireAuth=`0` &recaptcha=`0` ]]
                    


                    Should be:

                    [[!QuipReply? &thread=`article-3-[[*id]]` &preHooks=`recaptchav2` &closeAfter=`0` &moderate=`1` &requireAuth=`0` &recaptcha=`0` &tplAddComment=`resolveQuipAddComment` ]]
                    

                    I believe I tried this before referring to help here. I'll certainly try it again to make sure, and combine it with LK's suggestion of clearing the cache.
                      • 8168
                      • 1,118 Posts
                      Sorry - also - just checking things try this:

                      &thread=`article-b3-[[*id]]`
                      


                      Instead of:
                      &thread=`article-3-[[*id]]`
                      

                      [ed. note: dubbs last edited this post 8 years, 6 months ago.]