Skip to content

Commit fc6c7f1

Browse files
MC-29917: [OnPrem] Issue with Catalog Price rules - active in DB but not applying on frontend
1 parent 5ad40fa commit fc6c7f1

File tree

1 file changed

+23
-0
lines changed
  • app/code/Magento/Indexer/Model/ResourceModel/Indexer

1 file changed

+23
-0
lines changed

app/code/Magento/Indexer/Model/ResourceModel/Indexer/State.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
*/
66
namespace Magento\Indexer\Model\ResourceModel\Indexer;
77

8+
use Magento\Framework\Indexer\StateInterface;
9+
10+
/**
11+
* Resource model for indexer state
12+
*/
813
class State extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
914
{
1015
/**
@@ -17,4 +22,22 @@ protected function _construct()
1722
$this->_init('indexer_state', 'state_id');
1823
$this->addUniqueField(['field' => ['indexer_id'], 'title' => __('State for the same indexer')]);
1924
}
25+
26+
/**
27+
* @inheritDoc
28+
*/
29+
protected function prepareDataForUpdate($object)
30+
{
31+
$data = parent::prepareDataForUpdate($object);
32+
33+
if (isset($data['status']) && StateInterface::STATUS_VALID === $data['status']) {
34+
$data['status'] = $this->getConnection()->getCheckSql(
35+
$this->getConnection()->quoteInto('status = ?', StateInterface::STATUS_WORKING),
36+
$this->getConnection()->quote($data['status']),
37+
'status'
38+
);
39+
}
40+
41+
return $data;
42+
}
2043
}

0 commit comments

Comments
 (0)