diff -Nuar a/vendor/magento/module-eav/Model/Entity/Collection/VersionControl/AbstractCollection.php b/vendor/magento/module-eav/Model/Entity/Collection/VersionControl/AbstractCollection.php index 631bfa3c2d2..5ecbf70c246 100644 --- a/vendor/magento/module-eav/Model/Entity/Collection/VersionControl/AbstractCollection.php +++ b/vendor/magento/module-eav/Model/Entity/Collection/VersionControl/AbstractCollection.php @@ -87,4 +87,15 @@ abstract class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\A $this->entitySnapshot->registerSnapshot($item); return $item; } + + /** + * Clear collection + * + * @return $this + */ + public function clear() + { + $this->entitySnapshot->clear($this->getNewEmptyItem()); + return parent::clear(); + } } diff -Nuar a/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/Snapshot.php b/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/Snapshot.php index 095b5accda7..a287fa5e1af 100644 --- a/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/Snapshot.php +++ b/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/Snapshot.php @@ -72,4 +72,18 @@ class Snapshot return false; } + + /** + * Clear snapshot data + * + * @param \Magento\Framework\DataObject|null $entity + */ + public function clear(\Magento\Framework\DataObject $entity = null) + { + if ($entity !== null) { + $this->snapshotData[get_class($entity)] = []; + } else { + $this->snapshotData = []; + } + } }