From 9512135bb95546e9b58dbb898ce8a5039ad6d3d4 Mon Sep 17 00:00:00 2001 From: Marine PASQUIN Date: Wed, 7 Jun 2023 12:55:35 +0200 Subject: [PATCH 1/2] Category entity_id and row_id could be not consistant In select columns, it is always `p`.`row_id`. It should be IFNULL(p.row_id, _entity_id) AS `row_id`. --- Job/Category.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Job/Category.php b/Job/Category.php index 3f76b22e..e4a381ac 100755 --- a/Job/Category.php +++ b/Job/Category.php @@ -606,7 +606,8 @@ public function createEntities() $rowIdExists = $this->entitiesHelper->rowIdColumnExists($table); if ($rowIdExists) { $this->entities->addJoinForContentStagingCategory($parents, ['p.row_id']); - $values['row_id'] = 'IFNULL (p.row_id, _entity_id)'; // on category creation, row_id is null + $values['row_id'] = new Expr('IFNULL (p.row_id, _entity_id)'); // on category creation, row_id is null + $parents->reset(\Zend_Db_Select::COLUMNS)->columns($values); // update select columns } $connection->query( From d7d0d47b72217f6a914137e6e8a3b69a6425cf3b Mon Sep 17 00:00:00 2001 From: Marine PASQUIN Date: Wed, 7 Jun 2023 12:57:40 +0200 Subject: [PATCH 2/2] Product entity_id and row_id could be not consistant In select columns, it is always `p`.`row_id`. It should be IFNULL(p.row_id, _entity_id) AS `row_id`. --- Job/Product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Job/Product.php b/Job/Product.php index d5ecad3a..52f45cb9 100644 --- a/Job/Product.php +++ b/Job/Product.php @@ -1832,7 +1832,8 @@ public function createEntities() $rowIdExists = $this->entitiesHelper->rowIdColumnExists($table); if ($rowIdExists) { $this->entities->addJoinForContentStaging($parents, ['p.row_id']); - $values['row_id'] = 'IFNULL (p.row_id, _entity_id)'; // on product creation, row_id is null + $values['row_id'] = new Expr('IFNULL (p.row_id, _entity_id)'); // on product creation, row_id is null + $parents->reset(\Zend_Db_Select::COLUMNS)->columns($values); // update select columns } /** @var string $query */