diff --git a/src/CoreShop/Bundle/ResourceBundle/Doctrine/ORM/EntityMerger.php b/src/CoreShop/Bundle/ResourceBundle/Doctrine/ORM/EntityMerger.php index dd4c28fd63..8a254bc88a 100644 --- a/src/CoreShop/Bundle/ResourceBundle/Doctrine/ORM/EntityMerger.php +++ b/src/CoreShop/Bundle/ResourceBundle/Doctrine/ORM/EntityMerger.php @@ -127,6 +127,14 @@ private function checkAssociations($entity, $managedCopy, array &$visited): void //Reset new Data, for some reason the line above resets newData $newData = $class->reflFields[$assoc['fieldName']]->getValue($entity); + if (!$newCollection instanceof PersistentCollection) { + $newCollection = new PersistentCollection( + $this->em, + $class, + $newCollection + ); + } + $this->mergeCollection($origData, $newData, $assoc, static function ($foundEntry) use ($newCollection) { $newCollection->removeElement($foundEntry); }, $visited); diff --git a/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/coreExtension/data/coreShopRelations.js b/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/coreExtension/data/coreShopRelations.js index b470ed6ead..6f80ee434e 100644 --- a/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/coreExtension/data/coreShopRelations.js +++ b/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/coreExtension/data/coreShopRelations.js @@ -86,7 +86,7 @@ pimcore.object.classes.data.coreShopRelations = Class.create(coreshop.object.cla { xtype: 'combo', fieldLabel: t("coreshop_allowed_stack"), - name: "classes", + name: "stacks", id: 'coreshop_relation_stack_' + this.uniqeFieldId, value: this.datax.stack, store: stacks,