-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Product flat tables broken, ref #2603 #2658
Comments
Good find! I swear Magento is gonna make me have trust issues :D |
The original magento-lts/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php Lines 441 to 447 in cc6317a
|
but why zend_db doesn't put an "AND" between the two "1=1", that's super weird |
Seems like this is very critical |
Because they are just replacing |
yes but anyway the "setPart()" gets an array of conditions and should put and "AND" between them |
Is anyone working on this or should I get my hand dirty? |
I was checkin before but had to stop for a couple of hours, i'll try again later |
PR sent :-) |
Please correct me, but flat tables only includes enabled products. Was it right to add status filter here? |
that's right, as far as I wrong, flat should only include enabled products |
Writing from smartphone and will test again later ... Revert change to Catalog\Model\Product\Layer should fix it too. For flat tables status check isn't required, do we need it for eav tables? |
mmmm not exactly, we should check if flat is enabled in that point, so I guess it's more correct as it is now with the new PR I submitted. IMHO |
Flat table check already exists. |
It is the first condition from initSelect(), not? |
ah ok, in that file yes, I was checkin app/code/core/Mage/Catalog/Model/Layer.php which you commented about before. i'm updating the other PR |
@sreichel updated, but I'd still keep the changes to the "where" management which is wrong nevertheless |
Can we just revert changes that are not related to backend grids product visibility/status? Everything else should address to a new issue/pr. |
But that was my first solution… and it worked… |
Can’t do it anyway now |
For flat tables OFF the query changed from ...
To ....
If confirmed please partially revert :( |
I don't know what partially revert means, linked PR already reverts that. |
I mean close #2659 and revert changes in Catalog\Model\Layer.php |
why revert the whole thing when we can just fix that one line? |
I still think #2659 is correct, I don't know how to partially revert a merged PR anyway. |
Just revert changes to Catalog\Model\Layer.php ... This introduced a bug that was not in before. Instead of making more changes with unpredictable impact (changed query for eav tables) i'd prefer to revert this part. |
done, but that's not the problem, the problem is that the setPart('where') is wrong. |
Not sure about "wrong" ... If we can fix this issue with reverting some lines we should do it and take a look at this method in a seperate task. |
1=1 is not the point, setPart(where) is used in a wrong way, used this way it loses the "AND/OR" where type, that's why it has to be fixed. and that's why 3 lines below the 1=1 there's the correct usage for the "$excludeJoinPart". also, 1=1 looks like an uwful (but also pretty useless if written in a better way) to manage that, which is anyway done 3 lines below (probably it was written by multiple people in different times). |
The complete explanation: #2660 |
IMHO ... the only problem is the change to This lines have been added ...
W/o nothing else has to be changed. |
You said to modify the other one |
And the setpart wrong implementation still stands |
Then you got me wrong. Sorry. |
… |
Catalog\Model*Product*\Layer.php was missleading? :( |
i don’t understand anymore |
Anyway it’s 1.30AM so I’ll pass |
Preconditions (*)
Steps to reproduce (*)
Actual result (*)
See
WHERE 1=1 1=1
... related code ...Mage_Catalog_Model_Resource_Layer_Filter_Price::_getSelect()
Before #2603
After:
The text was updated successfully, but these errors were encountered: