$mapperKeys = $params['mapper'][1];
- $checkEmpty = 0;
- foreach ($mapperKeys as $value) {
- if ($value[0]) {
- $checkEmpty++;
+ $mappedFields = [];
+ foreach ((array) $mapperKeys as $field) {
+ if (!empty($field[1])) {
+ $mappedFields[] = CRM_Core_BAO_Mapping::getMappingParams([], $field);
}
}
- if (!$checkEmpty) {
+ if (!$mappedFields) {
$this->set('mappingId', NULL);
CRM_Utils_System::redirect(CRM_Utils_System::url($currentPath, '_qf_Map_display=true' . $urlParams));
}
$this->get('componentIds'),
(array) $this->get('queryParams'),
$this->get(CRM_Utils_Sort::SORT_ORDER),
- $mapperKeys,
+ $mappedFields,
$this->get('returnProperties'),
$this->get('exportMode'),
$this->get('componentClause'),