From 011d9c1e0a4da99d772b5e9c234e93982b2168bd Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 7 Aug 2019 15:43:43 +1200 Subject: [PATCH] Fix (unreleased regression) e-notices on import form When doing this extraction https://github.com/civicrm/civicrm-core/commit/0e3fc0224be2e0db48691ca96cc10dec4ab801db The function pass-by-reference calls hid the fact that the & needed to be passed in causing e-notices. In fact there are still some enotices after this which I'm still investigating but this partially fixes & is mergeable in itself - the other can be follow up --- CRM/Contact/Import/Form/MapField.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 903f2278c0..08f9dd752b 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -400,7 +400,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { $sel = &$this->addElement('hierselect', "mapper[$i]", ts('Mapper for Field %1', [1 => $i]), NULL); if ($this->get('savedMapping')) { - list($mappingName, $key, $defaults, $js, $columnPatterns, $dataPatterns) = $this->loadSavedMapping($mappingName, $i, $mappingRelation, $mappingWebsiteType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $defaults, $formName, $js, $hasColumnNames); + list($mappingName, $key, $defaults, $js) = $this->loadSavedMapping($mappingName, $i, $mappingRelation, $mappingWebsiteType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $defaults, $formName, $js, $hasColumnNames, $dataPatterns, $columnPatterns); } else { $js .= "swapOptions($formName, 'mapper[$i]', 0, 3, 'hs_mapper_0_');\n"; @@ -860,10 +860,12 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { * @param string $formName * @param string $js * @param bool $hasColumnNames + * @param array $dataPatterns + * @param array $columnPatterns * * @return array */ - protected function loadSavedMapping($mappingName, $i, $mappingRelation, $mappingWebsiteType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $defaults, $formName, $js, $hasColumnNames) { + protected function loadSavedMapping($mappingName, $i, $mappingRelation, $mappingWebsiteType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $defaults, $formName, $js, $hasColumnNames, $dataPatterns, $columnPatterns) { $jsSet = FALSE; if (isset($mappingName[$i])) { if ($mappingName[$i] != ts('- do not import -')) { @@ -999,7 +1001,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { $defaults["mapper[$i]"] = [$this->defaultFromData($dataPatterns, $i)]; } } - return [$mappingName, $key, $defaults, $js, $columnPatterns, $dataPatterns]; + return [$mappingName, $key, $defaults, $js]; } } -- 2.25.1