Commit 43159a02 authored by Karamel's avatar Karamel
Browse files

Fix potential call to unexisting getReference() in model merge (use id instead)

parent ac83e3ef
......@@ -226,13 +226,10 @@ abstract class DoctrineModel
$struct[], null);
}
if (!empty($field['array']) && !is_array($struct[$fieldName])) {
$ref = $this->getReference();
if (array_key_exists(static::getReferenceKey(), $struct)) {
$ref = $struct[static::getReferenceKey()];
}
$id = $this->getId();
throw new InvalidFieldException(InvalidFieldException::ARRAY,
static::class, $field['name'],
$ref, null);
$id, null);
}
// Get value and assign it.
$arrayField = !empty($field['array']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment