-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrote Mage_Reports_Model_Resource_Review_Product_Collection/Mage_Reports_Model_Resource_Order_Collection queries for a correct use of Zend_Db_Expr #2864
Conversation
…or a correct use of Zend_Db_Expr
By the way, this is the only file in which I found the $helper->prepareColumn() method used. Regarding the usage of the sprintf function, changed in this PR 'avg_rating' => sprintf('%s/%s', $sumPercentField, $countRatingId) I found references in a few files. |
I found something usable (since there are hundreds of occurrencies it's impossible to manually check them all) in the tax reports (reports are where it's more common to aggregate data) and tax calculations, but I couldn't trigger any error. |
I found 2 other occurrences in the Reports module if you wanna include them in this PR: magento-lts/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php Lines 594 to 611 in 583113d
|
@elidrissidev thanks, I pushed a fix for that class too. But I couldn't trigger the error (or that collection) in the "orders" report |
Same, I couldn't see where that method is called. But after trying that expression in a script it indicates the issue should be happening in that part too. |
This PR fixes #2237 which is triggered because of #2857 (comment)
'app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php' wasn't written super well, when 'sprintf' was applied on
Zend_Db_Expr
objects (returned by '$helper->prepareColumn) you're actually removing the
Zend_Db_Expr` and converting it to a normal string (which is wrong).