Notice fix on isHonor
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 8 May 2023 04:40:16 +0000 (16:40 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 8 May 2023 04:44:13 +0000 (16:44 +1200)
CRM/Contribute/Form/Contribution/Main.php
templates/CRM/Contribute/Form/Contribution/Main.tpl

index 28d3b62023e80ad9f9515f4e21ad0e37ae76c40b..5d5132686dd1ec429c25b471f88b0202ba18dceb 100644 (file)
@@ -432,7 +432,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $prms = ['id' => $this->_pcpId];
       CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $prms, $pcpInfo);
       if ($pcpInfo['is_honor_roll']) {
-        $this->assign('isHonor', TRUE);
         $this->add('checkbox', 'pcp_display_in_roll', ts('Show my contribution in the public honor roll'), NULL, NULL,
           ['onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID|personalNoteID','block','radio',false); pcpAnonymous( );"]
         );
index a7ee32e09e5eb1db14e451b97dbc01d5f512308e..4921d72625090ce45590b189739161cda2e9b6ba 100644 (file)
         {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
       </div>
 
-      {if $isHonor}
+      {if array_key_exists('pcp_display_in_roll', $form)}
         <fieldset class="crm-public-form-item crm-group pcp-group">
           <div class="crm-public-form-item crm-section pcp-section">
             <div class="crm-public-form-item crm-section display_in_roll-section">
     {/if}
   </div>
   <script type="text/javascript">
-    {if $isHonor}
-    pcpAnonymous();
+    {if array_key_exists('pcp_display_in_roll', $form)}
+      pcpAnonymous();
     {/if}
 
     {literal}