From 81648fbc1f85d661e32e62bebc315f7a61537630 Mon Sep 17 00:00:00 2001 From: Noah Miller Date: Fri, 10 Mar 2023 19:59:23 -0500 Subject: [PATCH] eliminate notice in non-dialog mode too, make var name clearer, fix another couple notices --- CRM/Profile/Form.php | 9 +++++---- templates/CRM/Profile/Form/Dynamic.tpl | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 5bb2cf99d8..3c2e669fb6 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -247,7 +247,7 @@ class CRM_Profile_Form extends CRM_Core_Form { // The button 'Save Matching Contact' is added in buildForm // but we only decide here whether ot not to show it - ie // if validation failed due to there being duplicates. - CRM_Core_Smarty::singleton()->assign('isDuplicate', 1); + CRM_Core_Smarty::singleton()->assign('showSaveDuplicateButton', 1); } else { $errors['_qf_default'] = ts('A record already exists with the same information.'); @@ -904,10 +904,11 @@ class CRM_Profile_Form extends CRM_Core_Form { $this->freeze(); } + // Assign FALSE, here - this is overwritten during form validation + // if duplicates are found during submit. + CRM_Core_Smarty::singleton()->assign('showSaveDuplicateButton', FALSE); + if ($this->isEntityReferenceContactCreateMode()) { - // Assign FALSE, here - this is overwritten during form validation - // if duplicates are found during submit. - CRM_Core_Smarty::singleton()->assign('isDuplicate', FALSE); $this->addElement( 'xbutton', $this->getButtonName('upload', 'duplicate'), diff --git a/templates/CRM/Profile/Form/Dynamic.tpl b/templates/CRM/Profile/Form/Dynamic.tpl index 65119cf15a..eb2ef70c6a 100644 --- a/templates/CRM/Profile/Form/Dynamic.tpl +++ b/templates/CRM/Profile/Form/Dynamic.tpl @@ -35,7 +35,7 @@
{/if} - {if array_key_exists('_qf_Edit_upload_duplicate', $form) && $isDuplicate} + {if $showSaveDuplicateButton}
{$form._qf_Edit_upload_duplicate.html}
@@ -50,7 +50,7 @@ {if $action eq 2 and $multiRecordFieldListing}

{ts}Edit Details{/ts}

- {include file="CRM/common/formButtons.tpl" location=''}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} + {include file="CRM/common/formButtons.tpl" location=''}{if $showSaveDuplicateButton}{$form._qf_Edit_upload_duplicate.html}{/if}
{/if} @@ -94,7 +94,7 @@
{$field.help_pre}
{/if} - {if $field.options_per_line} + {if array_key_exists('options_per_line', $field) && $field.options_per_line}
{$form.$n.label}
@@ -201,7 +201,7 @@
{/if}
- {include file="CRM/common/formButtons.tpl" location=''}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} + {include file="CRM/common/formButtons.tpl" location=''}{if $showSaveDuplicateButton}{$form._qf_Edit_upload_duplicate.html}{/if} {if $includeCancelButton} -- 2.25.1