Skip to content

Commit

Permalink
Simplify label_is_translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Apr 18, 2024
1 parent 3478cfe commit cc99173
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions application/src/Api/Adapter/AbstractResourceEntityAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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']))),
];
}
Expand Down

0 comments on commit cc99173

Please sign in to comment.