From 29c421688c60b529b6059d127070141e9e2d40f4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 1 Jul 2021 12:30:36 +1200 Subject: [PATCH] Tpl enotice fix I searched for hideStepNumbers & believe it is never assigned --- CRM/Contact/Import/Form/DataSource.php | 10 +++++----- .../CRM/Contact/Import/Form/DataSource.tpl | 2 +- templates/CRM/common/WizardHeader.tpl | 18 +++--------------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index a95ace603cda..ead2b2435d1f 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -89,12 +89,12 @@ public function preProcess() { $this->_dataSourceIsValid = TRUE; $this->assign('showDataSourceFormPane', TRUE); $dataSourcePath = explode('_', $this->_dataSource); - $templateFile = "CRM/Contact/Import/Form/" . $dataSourcePath[3] . ".tpl"; - $this->assign('dataSourceFormTemplateFile', $templateFile); + $templateFile = 'CRM/Contact/Import/Form/' . $dataSourcePath[3] . ".tpl"; } elseif ($this->_dataSource) { $this->invalidConfig('Invalid data source'); } + $this->assign('dataSourceFormTemplateFile', $templateFile ?? NULL); } /** @@ -201,9 +201,9 @@ public function setDefaultValues() { 'fieldSeparator' => $config->fieldSeparator, ]; - if ($loadeMapping = $this->get('loadedMapping')) { - $this->assign('loadedMapping', $loadeMapping); - $defaults['savedMapping'] = $loadeMapping; + $this->assign('loadedMapping', $this->get('loadedMapping')); + if ($this->get('loadedMapping')) { + $defaults['savedMapping'] = $this->get('loadedMapping'); } return $defaults; diff --git a/templates/CRM/Contact/Import/Form/DataSource.tpl b/templates/CRM/Contact/Import/Form/DataSource.tpl index 5009af8a1958..9ec25937a321 100644 --- a/templates/CRM/Contact/Import/Form/DataSource.tpl +++ b/templates/CRM/Contact/Import/Form/DataSource.tpl @@ -83,7 +83,7 @@ { /if} - {if $form.disableUSPS} + {if isset($form.disableUSPS)} {$form.disableUSPS.html} diff --git a/templates/CRM/common/WizardHeader.tpl b/templates/CRM/common/WizardHeader.tpl index 01daa5244622..ddf44bae71ce 100644 --- a/templates/CRM/common/WizardHeader.tpl +++ b/templates/CRM/common/WizardHeader.tpl @@ -27,33 +27,21 @@ {else} {* This is a sub-step *} {assign var="stepClass" value="past-sub-step"} {/if} - {if $wizard.style.hideStepNumbers} - {assign var="stepPrefix" value=$wizard.style.subStepPrefixPast} - {else} - {assign var="stepPrefix" value=$wizard.style.stepPrefixPast|cat:$wizard.steps[step].stepNumber|cat:". "} - {/if} + {assign var="stepPrefix" value=$wizard.style.stepPrefixPast|cat:$wizard.steps[step].stepNumber|cat:". "} {elseif $wizard.currentStepNumber == $wizard.steps[step].stepNumber} {if $wizard.steps[step].step} {assign var="stepClass" value="current-step"} {else} {assign var="stepClass" value="current-sub-step"} {/if} - {if $wizard.style.hideStepNumbers} - {assign var="stepPrefix" value=$wizard.style.subStepPrefixCurrent} - {else} - {assign var="stepPrefix" value=$wizard.style.stepPrefixCurrent|cat:$wizard.steps[step].stepNumber|cat:". "} - {/if} + {assign var="stepPrefix" value=$wizard.style.stepPrefixCurrent|cat:$wizard.steps[step].stepNumber|cat:". "} {else} {if $wizard.steps[step].step} {assign var="stepClass" value="future-step"} {else} {assign var="stepClass" value="future-sub-step"} {/if} - {if $wizard.style.hideStepNumbers} - {assign var="stepPrefix" value=$wizard.style.subStepPrefixFuture} - {else} - {assign var="stepPrefix" value=$wizard.style.stepPrefixFuture|cat:$wizard.steps[step].stepNumber|cat:". "} - {/if} + {assign var="stepPrefix" value=$wizard.style.stepPrefixFuture|cat:$wizard.steps[step].stepNumber|cat:". "} {/if} {if !$wizard.steps[step].valid} {assign var="stepClass" value="$stepClass not-valid"}