From cc50ef3a1dd04465b1a3a658c1c9455edb64a11a Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Mon, 26 Apr 2021 22:53:23 +0100 Subject: [PATCH] Use CRM_Utils_ReCAPTCHA::enableCaptchaOnForm directly in ContributionBase --- CRM/Contribute/Form/Contribution/Main.php | 2 +- CRM/Contribute/Form/ContributionBase.php | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index b6c29b41fc..4af70d3c8e 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -292,7 +292,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if (count($this->_paymentProcessors) >= 1 && !$this->get_template_vars("isCaptcha") && $this->hasToAddForcefully()) { if (!$this->_userID) { - $this->enableCaptchaOnForm(); + CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this); } else { $this->displayCaptchaWarning(); diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 9749d03e47..c90648d8ea 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -756,19 +756,12 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { } if ($addCaptcha && !$viewOnly) { - $this->enableCaptchaOnForm(); + CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this); } } } } - /** - * Enable ReCAPTCHA on Contribution form - */ - protected function enableCaptchaOnForm() { - CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this); - } - /** * Assign payment field information to the template. * -- 2.25.1