Skip to content

Commit

Permalink
Ensure no hard fail if field not defined #66
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Sep 25, 2023
1 parent 004283f commit 01c3c5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CRM/Csvimport/Import/Parser/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ protected function getReferenceFields(): array {

if (count($fieldsInUniqueIndex) === 1) {
$indexFieldName = $fieldsInUniqueIndex[0];

// skip special case fields (such as the address.external_identifier)
if (empty($entityFieldMetadata[$indexFieldName])) {
continue;
}

$indexFieldMetadata = array_merge(
$entityFieldMetadata[$indexFieldName], [
(array) $entityFieldMetadata[$indexFieldName], [
'referenced_field' => $referenceField,
'entity_name' => $entityName,
'entity_field_name' => $indexFieldName,
Expand Down
4 changes: 2 additions & 2 deletions csvimport.civix.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ function _csvimport_civix_insert_navigation_menu(&$menu, $path, $item) {
if (empty($path)) {
$menu[] = [
'attributes' => array_merge([
'label' => CRM_Utils_Array::value('name', $item),
'active' => 1,
'label' => $item['name'] ?? NULL,
'active' => 1,
], $item),
];
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</classloader>
<civix>
<namespace>CRM/Csvimport</namespace>
<format>23.02.0</format>
<format>23.02.1</format>
</civix>
<mixins>
<mixin>menu-xml@1.0.0</mixin>
Expand Down

0 comments on commit 01c3c5a

Please sign in to comment.