Fix #466 - [Legacy] add array check on Id Field Validator

This commit is contained in:
Jack Anderson 2024-07-02 10:13:31 +01:00 committed by Clemente Raposo
parent d792f03aff
commit 3f0448efe8

View file

@ -15,6 +15,10 @@ class IdFieldValidator implements FieldValidatorInterface
return '';
}

if (is_array($value)) {
$value = $value[0]['id'] ?? $value['id'];
}

if (!is_string($value) && !is_numeric($value)) {
return "Invalid id field '$field'. Value not a string nor a number";
}