From ae0abd3ac97343cbdf02432d4e04e33a74ff1a7f Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Thu, 29 Mar 2018 10:20:31 +0200 Subject: [PATCH] Set hasDataChanges to true when instantiating a model with a factory --- lib/internal/Magento/Framework/Model/AbstractModel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index b9b607a0f7631..eb4b30e01c020 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -190,6 +190,10 @@ public function __construct( $this->_idFieldName = $this->_getResource()->getIdFieldName(); } + if (!empty($data)) { + $this->_hasDataChanges = true; + } + parent::__construct($data); $this->_construct(); }