Skip to content

Commit

Permalink
[Bug]: Objectbricks ManyToOneRelation throws warning if no relations …
Browse files Browse the repository at this point in the history
…are present. #9900 (#9904)

* [Bug]: Objectbricks ManyToOneRelation throws warning if no relations are present. #9900

* Update models/DataObject/ClassDefinition/Data/Objectbricks.php

Co-authored-by: Divesh Pahuja <divesh.pahuja@pimcore.com>

Co-authored-by: Divesh Pahuja <divesh.pahuja@pimcore.com>
  • Loading branch information
weisswurstkanone and dvesh3 committed Jul 30, 2021
1 parent 1e2adbc commit 5b5c7ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/DataObject/ClassDefinition/Data/Objectbricks.php
Expand Up @@ -247,7 +247,7 @@ private function getDataForField($item, $key, $fielddefinition, $level, $baseObj
}
$data = [];

if ($fielddefinition instanceof ManyToOneRelation) {
if ($fielddefinition instanceof ManyToOneRelation && isset($relations[0])) {
$data = $relations[0];
} else {
foreach ($relations as $rel) {
Expand Down

0 comments on commit 5b5c7ca

Please sign in to comment.