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

REF reCAPTCHA Simplify buildCustom function on Registration form #20164

Merged

Conversation

mattwire
Copy link
Contributor

Overview

This is a refactor in preparation for moving the reCAPTCHA code to the new reCAPTCHA extension for the event registration pages.
See https://lab.civicrm.org/dev/core/-/issues/2571

Before

More complex code

After

Simpler code, will be easier to review next step which actually moves the code that adds the reCAPTCHA.

Technical Details

Split into 3 commits for ease of review.

  1. Typos in comments and unused code lines.
  2. Simplify the buildCustom function (use ?w=1 in URL to see that this is only removing the if that wraps everything in the function, switching to CRM_Core_Session::getLoggedInContactID(); and moving the $button to nearer the only place it is used.
  3. $viewOnly parameter is never used in this function (looks like a copy/paste from other code that left it in place).

Comments

@civibot
Copy link

civibot bot commented Apr 27, 2021

(Standard links)

@civibot civibot bot added the master label Apr 27, 2021
@eileenmcnaughton
Copy link
Contributor

I did a trawl & didn't find any evidence that viewOnly is passed in so I agree with cleaning it up

@eileenmcnaughton eileenmcnaughton merged commit a4e0994 into civicrm:master Apr 27, 2021
@mattwire mattwire deleted the recaptcharegistrationbuildcustom branch April 27, 2021 20:05
@mattwire
Copy link
Contributor Author

Thankyou @eileenmcnaughton

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.

2 participants