Skip to content

Commit

Permalink
Merge pull request #15015 from eileenmcnaughton/import_message
Browse files Browse the repository at this point in the history
[REF] [Import] Minor cleanup on status setting.
  • Loading branch information
seamuslee001 authored Aug 15, 2019
2 parents a12d53c + 0b786e4 commit ca231c6
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions CRM/Contact/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ public function buildQuickForm() {
$js = "<script type='text/javascript'>\n";
$formName = 'document.forms.' . $this->_name;
//used to warn for mismatch column count or mismatch mapping
$warning = 0;
CRM_Core_Session::singleton()->setStatus(NULL);

for ($i = 0; $i < $this->_columnCount; $i++) {
$sel = &$this->addElement('hierselect', "mapper[$i]", ts('Mapper for Field %1', [1 => $i]), NULL);

Expand Down Expand Up @@ -441,16 +442,7 @@ public function buildQuickForm() {
if (isset($mappingName) &&
($this->_columnCount != count($mappingName))
) {
$warning++;
}

if ($warning != 0 && $this->get('savedMapping')) {
$session = CRM_Core_Session::singleton();
$session->setStatus(ts('The data columns in this import file appear to be different from the saved mapping. Please verify that you have selected the correct saved mapping before continuing.'));
}
else {
$session = CRM_Core_Session::singleton();
$session->setStatus(NULL);
CRM_Core_Session::singleton()->setStatus(ts('The data columns in this import file appear to be different from the saved mapping. Please verify that you have selected the correct saved mapping before continuing.'));
}

$this->setDefaults($defaults);
Expand Down

0 comments on commit ca231c6

Please sign in to comment.