Skip to content

Commit

Permalink
Ensure "convert_data_types" is an array (fix #2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Jan 25, 2025
1 parent 6692b9d commit e2b2ccb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/src/Api/Adapter/ValueHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ public function hydrate(Request $request, Resource $entity,
// Convert data types.
if ($isUpdate) {
$logger = $adapter->getServiceLocator()->get('Omeka\Logger');
$convertSpecs = $representation['convert_data_types'] ?? [];
$convertSpecs = (isset($representation['convert_data_types']) && is_array($representation['convert_data_types']))
? $representation['convert_data_types'] : [];
foreach ($convertSpecs as $convertSpec) {
$propertyId = $convertSpec['convert_property_id'] ?? null;
$dataTypeSource = $convertSpec['convert_data_type_source'] ?? null;
Expand Down

0 comments on commit e2b2ccb

Please sign in to comment.