For most of us, Composer is not a solution, couldn’t Ludwig be used as well? Failing that, I will be forced to say goodbye to the reCAPCHA module and switch to Honeypot ...

Issue fork recaptcha-3152474

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

druhu created an issue. See original summary.

ConradFlashback’s picture

+1

devad’s picture

Title: Ludwig support » reCAPTCHA - Ludwig integration
devad’s picture

StatusFileSize
new290 bytes

Hi to all maintainers of reCAPTCHA module.

I am Ludwig module co-maintainer.

I would like to support idea that you add Ludwig integration into reCAPTCHA module by providing ludwig.json file inside your module's root folder in all future reCAPTCHA module 8.x-3.x releases.

This would make the life of users not friendly with Composer much easier. :)

google/recaptcha library should be added to ludwig.json file in order for reCAPTCHA module to work nicely with Ludwig.

{
  "require": {
    "google/recaptcha": {
      "version": "v1.2.4",
      "url": "https://github.com/google/recaptcha/archive/1.2.4.zip"
    }
  }
}

Maintenance would not be a big issue. Once new reCAPTCHA module release is out and if library dependencies has changed - ludwig.json file should be updated to new library requirements by reCAPTCHA module maintainers just like composer.json file is updated.

google/recaptcha library does not have any further library dependences, so implementation is straightforward.

Here is the patch.

devad’s picture

devad’s picture

devad’s picture

Status: Active » Needs review
joshuautley’s picture

#4 worked for me. Thank you for the ludwig solution!

devad’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for review. Marking RTBC as per #8.

webdevfreak’s picture

This issue is still active in Drupal 9 and need fixing. I have tried both options i.e composer and ludwig but no luck.

reCAPTCHA Version: 8.x-3.0

Drupal Version: 9.1.4

PHP Version: 7.4.21

Error message:
"The website encountered an unexpected error. Please try again later.
Error: Class 'ReCaptcha\ReCaptcha' not found in recaptcha_captcha_validation() (line 164 of modules/contrib/recaptcha/recaptcha.module)."

devad’s picture

Re #10

Did you use the patch #4 provided here when you have tested reCAPTCHA Version: 8.x-3.0 with Ludwig?

If yes, can you please post the screenshot of your Report > Packages page here for review.

webdevfreak’s picture

@ devad

Thanks for the reply.

What you mean by saying 'post the screenshot of your Report > Packages page'?

I am getting above error message soon after form is submitted.

devad’s picture

Re: #12:

If you have Ludwig module properly installed visit Ludwig's packages status at Reports > Packages (/admin/reports/packages) and post screenshot of that page here.

kyber’s picture

Thank you for the ludwig.json - for those having issues, be sure to hit update.php after running the Ludwig install.

devad’s picture

Eventual commit would be nice.

reCAPTCHA project maintainers can read more at:

csbt23’s picture

This patch is a life saver for me right now. Any chances to have it as part of the next module release? I'm maintaining a couple of sites hosted on a server where I can't use composer (yes, I know, we should not host D8/D9 sites on such servers but I'm not the one deciding about...)

devad’s picture

Thank you for your review @csbt23.

Just a note... You do not need hosting who supports Composer in order to use and maintain your sites with Composer.

You can manage your site with Composer locally on your LAMP or WAMP server. Then zip-upload-unzip it to the hosting or use Git to sync it to hosting if your hosting supports Git.

You can Google search "How to locally install and maintain Drupal site with Composer" and find more info.

Anybody made their first commit to this issue’s fork.

anybody’s picture

Turned #4 into a MR for merging it soon! Thanks @devad! :)

anybody’s picture

  • Anybody committed bb7918b4 on 8.x-3.x
    Resolve #3152474 "Recaptcha   ludwig"
    
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

promo-il’s picture

patch #4 OK Drupal:8.9.20 PHP:7.3