From cc99173b8fb4f72e3b84502d882c4af7b89b4ab6 Mon Sep 17 00:00:00 2001 From: Jim Safley Date: Thu, 18 Apr 2024 09:03:08 -0400 Subject: [PATCH] Simplify label_is_translatable --- .../src/Api/Adapter/AbstractResourceEntityAdapter.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/application/src/Api/Adapter/AbstractResourceEntityAdapter.php b/application/src/Api/Adapter/AbstractResourceEntityAdapter.php index 8582c8076..3f8e3e4b2 100644 --- a/application/src/Api/Adapter/AbstractResourceEntityAdapter.php +++ b/application/src/Api/Adapter/AbstractResourceEntityAdapter.php @@ -692,12 +692,8 @@ public function getSubjectValueProperties(Resource $resource, $resourceType = nu // The shared label is translatable if at least one of the individual // labels is a property label. A shared label is not translatable if // all the individual labels are alternate labels. - if (isset($results[$result['property_id']][$label]['label_is_translatable'])) { - if (true === $labelIsTranslatable) { - $results[$result['property_id']][$label]['label_is_translatable'] = true; - } - } else { - $results[$result['property_id']][$label]['label_is_translatable'] = $labelIsTranslatable; + if ($labelIsTranslatable) { + $results[$result['property_id']][$label]['label_is_translatable'] = true; } } // Build the properties array from grouped array. @@ -708,7 +704,7 @@ public function getSubjectValueProperties(Resource $resource, $resourceType = nu 'label' => $label, 'property_id' => $propertyId, 'term' => $data['term'], - 'label_is_translatable' => $data['label_is_translatable'], + 'label_is_translatable' => $data['label_is_translatable'] ?? false, 'compound_id' => sprintf('%s:%s-%s', $resourceType, $propertyId, implode(',', array_unique($data['resource_template_property_ids']))), ]; }