File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,11 +67,37 @@ private function storeBeforeId($id) {
6767 * @return int
6868 */
6969 protected function getAction () {
70- if (isset ($ this ->beforeIds [$ this ->currentHash ]) AND $ this ->beforeIds [$ this ->currentHash ]) {
70+ if (
71+ // for models which call model_save_before
72+ $ this ->hadIdAtBefore ()
73+ OR
74+ // for models with origData but without model_save_before like Mage_CatalogInventory_Model_Stock_Item
75+ $ this ->hasOrigData ()
76+ ) {
7177 return Firegento_AdminLogger_Helper_Data::ACTION_UPDATE ;
7278 } else {
7379 return Firegento_AdminLogger_Helper_Data::ACTION_INSERT ;
7480 }
7581 }
7682
83+ /**
84+ * @return bool
85+ */
86+ private function hadIdAtBefore () {
87+ return (
88+ isset ($ this ->beforeIds [$ this ->currentHash ])
89+ AND $ this ->beforeIds [$ this ->currentHash ]
90+ );
91+ }
92+
93+ /**
94+ * @return bool
95+ */
96+ private function hasOrigData () {
97+ $ data = $ this ->savedModel ->getOrigData ();
98+ // unset website_ids as this is even on new entities set for catalog_product models
99+ unset($ data ['website_ids ' ]);
100+ return (bool )$ data ;
101+ }
102+
77103}
Original file line number Diff line number Diff line change 1818 <fields >
1919 <updated_at />
2020 <update_time />
21+ <low_stock_date />
2122 </fields >
2223 </exclude >
2324 </firegento_adminlogger_config >
You can’t perform that action at this time.
0 commit comments