Remove warning about reCaptcha missing key from contribution page
authorMatthew Wire <mjw@mjwconsult.co.uk>
Mon, 26 Apr 2021 22:29:47 +0000 (23:29 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Tue, 27 Apr 2021 10:13:19 +0000 (11:13 +0100)
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/ContributionBase.php
templates/CRM/Contribute/Form/Contribution/Main.tpl

index 4af70d3c8ec3fb7f729efbbf98fe1f4e8d705873..3efe523d922f0132c7c9e46725ab871755fa4295 100644 (file)
@@ -294,9 +294,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       if (!$this->_userID) {
         CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this);
       }
-      else {
-        $this->displayCaptchaWarning();
-      }
     }
 
     // Build payment processor form
index c90648d8ea6948d1118d48b7d659f1ce2f866805..58e15df2afd756adfa737fdda66314c8ed165aa8 100644 (file)
@@ -820,17 +820,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     }
   }
 
-  /**
-   * Display ReCAPTCHA warning on Contribution form
-   */
-  protected function displayCaptchaWarning() {
-    if (CRM_Core_Permission::check("administer CiviCRM")) {
-      if (!CRM_Utils_ReCAPTCHA::hasSettingsAvailable()) {
-        $this->assign('displayCaptchaWarning', TRUE);
-      }
-    }
-  }
-
   /**
    * Check if ReCAPTCHA has to be added on Contribution form forcefully.
    */
index 1a8d2180539eaa113c6d2b478fe6c7b8ebcc3372..fcbb26bfac4170ac305eddc7c60466cfe9ae2e99 100644 (file)
     {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
   {/if}
 
-  {if $displayCaptchaWarning}
-    <div class="messages status no-popup">
-      {ts}To display reCAPTCHA on form you must get an API key from<br /> <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>{/ts}
-    </div>
-  {/if}
-
   {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') }
     {capture assign="buttonTitle"}{ts}Configure Contribution Page{/ts}{/capture}
     {crmButton target="_blank" p="civicrm/admin/contribute/settings" q="reset=1&action=update&id=`$contributionPageID`" fb=1 title="$buttonTitle" icon="fa-wrench"}{ts}Configure{/ts}{/crmButton}