किसी मित्र की वेबसाइट के लिए अभी-अभी 1.9.2.2 में अपग्रेड होने और इस समस्या में भाग लेने के बाद, मैंने फ़ाइल में निम्न पैच लगा दिया,
[magento/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php]
मैं यह नहीं कह सकता कि प्रवाह के क्या प्रभाव हो सकते हैं और भविष्य के अद्यतनों को सावधान रहना होगा कि यदि यह फ़ाइल निश्चित रूप से अधिलेखित है तो इस सुविधा को याद न करें, लेकिन आरंभ करने के लिए लाइन जोड़ें:
'rules_hash' => new Zend_Db_Expr('NULL'),
चयन कथन को इस प्रकार दिखाने के लिए:
$select = $this->_connection->select()
->from($indexSelect, array())
->joinInner(
array(
'dates' => $this->_connection->select()->union(
array(
new Zend_Db_Expr(
'SELECT ' . $this->_connection->getDateAddSql(
$this->_connection->fromUnixtime($time),
-1,
Varien_Db_Adapter_Interface::INTERVAL_DAY
) . ' AS rule_date'
),
new Zend_Db_Expr('SELECT ' . $this->_connection->fromUnixtime($time) . ' AS rule_date'),
new Zend_Db_Expr(
'SELECT ' . $this->_connection->getDateAddSql(
$this->_connection->fromUnixtime($time),
1,
Varien_Db_Adapter_Interface::INTERVAL_DAY
) . ' AS rule_date'
),
)
)
),
'1=1',
array()
)
->columns(
array(
'rule_product_price_id' => new Zend_Db_Expr('NULL'),
'rule_date' => 'dates.rule_date',
'customer_group_id' => 'customer_group_id',
'product_id' => 'product_id',
'rule_price' => 'MIN(rule_price)',
'website_id' => new Zend_Db_Expr($website->getId()),
'latest_start_date' => 'latest_start_date',
'earliest_end_date' => 'earliest_end_date',
/**
Added because rules_hash was created by some module and not handled properly,
see https://stackoverflow.com/questions/19480415/whats-wrong-with-this-magento-query
*/
'rules_hash' => new Zend_Db_Expr('NULL'),
)
)
->where(new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " >= from_time"))
->where(
$this->_connection->getCheckSql(
new Zend_Db_Expr('to_time = 0'),
new Zend_Db_Expr(1),
new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " <= to_time")
)
)
->group(array('customer_group_id', 'product_id', 'dates.rule_date'));
return $select;