Not a bug Entity/Manager getRelation could return null value event they are not

truonglv

Well-known member
Affected version
2.0.7
In the method Manager::getRelation(...) could be return null when the key has more than 1 element.

PHP:
return $this->find($relation['entity'], count($key) > 1 ? $key : reset($key), $extraWith);

It's maybe use the method: findOne when has more than 1 element?
 
Example:
PHP:
$key = [
    'content_type' => 'post',
    'content_id' => 1
];
So expect query:
Code:
WHERE content_type = ? AND content_id = ?

But the result is:
Code:
WHERE primaryKey IN ('post', 1)
 
Top Bottom