Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#1755 Fix reCaptcha on Mailing Subscribe #17305

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

mlutfy
Copy link
Member

@mlutfy mlutfy commented May 12, 2020

Overview

https://lab.civicrm.org/dev/core/-/issues/1755

The form submission will be accepted, without the challenge.

Before

civicrm-broken-recaptcha

After

civicrm-recaptcha-fixed

Technical Details

  • I cleaned up the code because the verification to see if the settings exist is already in the enableCaptchaOnForm function.
  • The "gross hack for now" goes back to 2009 and is not clear. Maybe there was a Drupal block back then? reference

@civibot civibot bot added the master label May 12, 2020
@civibot
Copy link

civibot bot commented May 12, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor

test this please

@mlutfy
Copy link
Member Author

mlutfy commented Jun 11, 2020

jenkins, test this please

@mlutfy
Copy link
Member Author

mlutfy commented Jun 16, 2020

jenkins, test this please

(I'm not sure I understand the test output, if relevant or not)

test output includes warnings such as:

ok 4958 - api_v3_WebsiteTest::testGetFields with data set #1 (4)
1..4958
PHP Deprecated:  Civi\Payment\PropertyBag related deprecation warnings:
Unknown property 'version'. We have merged this in for now as a custom property. Please rewrite your code to use PropertyBag->setCustomProperty if it is a genuinely custom property, or a standardised setter like PropertyBag->setContactID for standard properties
Unknown property 'debug'. We have merged this in for now as a custom property. Please rewrite your code to use PropertyBag->setCustomProperty if it is a genuinely custom property, or a standardised setter like PropertyBag->setContactID for standard properties
Unknown property 'price_2'. We have merged this in for now as a custom property. Please rewrite your code to use PropertyBag->setCustomProperty if it is a genuinely custom property, or a standardised setter like PropertyBag->setContactID for standard properties
Unknown property 'id'. We have merged this in for now as a custom property. Please rewrite your code to use PropertyBag->setCustomProperty if it is a genuinely custom property, or a sta in /home/jenkins/bknix-dfl/build/core-17305-3c8xz/web/sites/all/modules/civicrm/CRM/Core/Error/Log.php on line 58
PHP Stack trace:
PHP   1. {main}() /home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar:0
PHP   2. PHPUnit\TextUI\Command::main() /home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar:570
PHP   3. PHPUnit\TextUI\Command->run() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/Command.php:148
PHP   4. PHPUnit\TextUI\TestRunner->doRun() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/Command.php:195
PHP   5. Civi\Payment\PropertyBag::writeLegacyWarnings() /home/jenkins/bknix-dfl/build/core-17305-3c8xz/web/sites/all/modules/civicrm/Civi/Payment/PropertyBag.php:0
PHP   6. CRM_Core_Error_Log->warning() /home/jenkins/bknix-dfl/build/core-17305-3c8xz/web/sites/all/modules/civicrm/Civi/Payment/PropertyBag.php:198
PHP   7. CRM_Core_Error_Log->log() /home/jenkins/bknix-dfl/build/core-17305-3c8xz/web/sites/all/modules/civicrm/vendor/psr/log/Psr/Log/AbstractLogger.php:85
PHP   8. trigger_error() /home/jenkins/bknix-dfl/build/core-17305-3c8xz/web/sites/all/modules/civicrm/CRM/Core/Error/Log.php:58

@eileenmcnaughton
Copy link
Contributor

@mlutfy it's not blocking on this PR - I think agreeing an approach around this stuff is blocking progress on the property bag (& I think at the moment we're gonna hit pause on it) but for this PR it can be ignored.

@eileenmcnaughton
Copy link
Contributor

@jusfreeman I feel sure you volunteered to review this one...

@agileware-justin
Copy link
Contributor

@eileenmcnaughton happy to be volunteered to review PRs (and providing I have sufficient staff resources available) can do. However, we don't use this feature at all - have found it to be too problematic.

@eileenmcnaughton
Copy link
Contributor

@jusfreeman yes but you mentioned the word so in the meetup so you seemed an obvious victim

@mlutfy
Copy link
Member Author

mlutfy commented Jul 27, 2020

It takes 5-10 minutes to test on a site with reCaptcha enabled, and would be much appreciated, since civicrm.org uses this :)

(or we should flag it for deprecation, but afform is not yet able to support this use-case, unfortunately)

@agileware-justin
Copy link
Contributor

I have asked Pengyi to review this today which includes Review Standards and the short template.

C'mon, 5 - 10 minutes? That's not realistic at all. I've spent that long just reviewing this issue again.

Agileware Ref: CIVICRM-1529

@eileenmcnaughton
Copy link
Contributor

Thanks @jusfreeman & yes I agree review does take time

@agileware-pengyi
Copy link
Contributor

  • General standards
    • (r-explain) Pass
    • (r-user) Pass
    • (r-doc) Pass
    • (r-run) Issue: Recaptcha is working on the mailing subscribe form. But the success message is not shown after submitting the form. You can see the message in the first gif of description. This might be a different issue?
  • Developer standards
    • (r-tech) Pass: My review is based on WordPress and cannot see any reason to have the "gross hack". So good to remove it.
    • (r-code) Pass
    • (r-maint) Pass
    • (r-test) Pass

@agileware-justin
Copy link
Contributor

@eileenmcnaughton @mlutfy review done

Time worked, 1 hour 15 minutes

@eileenmcnaughton
Copy link
Contributor

Thanks @jusfreeman & thanks for adding some visibility on review time.

@mlutfy can you check the issue @agileware-pengyi pointed out

@mlutfy
Copy link
Member Author

mlutfy commented Jul 28, 2020

Sorry for my previous comment about review time, you're right.

"Recaptcha is working on the mailing subscribe form. But the success message is not shown after submitting the form. You can see the message in the first gif of description."

reCaptcha is displayed, but it's not validated. In the first GIF, I did not click on the reCaptcha to pass the challenge.

(I'm not sure if I understand correctly)

Thank you for the review!

@eileenmcnaughton
Copy link
Contributor

@mlutfy I understood the comment as suggesting the 'your subscription has been sent' text disappears

@mlutfy
Copy link
Member Author

mlutfy commented Jul 28, 2020

hmm, I'm still not sure I see it.

Here's an example from civicrm.org: https://civicrm.org/civicrm/mailing/subscribe

(I pre-filled the form, so that you don't have to stare while I type and pass a captcha)

mailing-subscribe-Peek 28-07-2020 16-06

@eileenmcnaughton
Copy link
Contributor

@agileware-pengyi can you please clarify?

@agileware-pengyi
Copy link
Contributor

@mlutfy @eileenmcnaughton I didn't see the message in my test, but your test does have it. My test environment is the wp-demo from the buildkit.

@eileenmcnaughton
Copy link
Contributor

@agileware-pengyi do you know if the message was there before? It's starting to sound like it might not be there with or without the patch in WP

@agileware-pengyi
Copy link
Contributor

@eileenmcnaughton yeah, just checked it and no message without the patch. So I think this is passed.

@eileenmcnaughton
Copy link
Contributor

@agileware-pengyi thanks for double checking - I'm guessing this got you over the 1.5 hours mark.

Merging

@eileenmcnaughton eileenmcnaughton merged commit 101f1f2 into civicrm:master Jul 28, 2020
@eileenmcnaughton eileenmcnaughton deleted the core1755 branch July 28, 2020 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants