Skip to content
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

Issues 5762 and 6799 and probably 5948 #7030

Conversation

nissablagojevic
Copy link

Small summary:

The array of subproducts retrieved by ConfigurableOptionsProvider()->getProducts($product) is incorrectly being limited to the first enabled product by the SQL generated in the LinkedProductSelectBuilders. If the first subproduct is out of stock, entire catalog crashes. This fix adds an optional argument to the LinkedProductSelectBuilders to allow them to retrieve more than 1 subproduct, fixing the crash.

This crash was acknowledged in #6799 but hasn't yet been assigned.

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Oct 15, 2016

CLA assistant check
All committers have signed the CLA.

Copy link

@sitepodmatt sitepodmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experienced this bug (as I guess anyone with a non-trivial store would). This changes fixes this oversight on M2 2.2 develop branch. This should be marked as critical

@mktudock
Copy link

Can confirm the bug and that this pull request fixes it. This is absolutely urgent and should be released as a patch for 1.1.2., otherwise we can't apply the security patch.

@Ctucker9233
Copy link

Please merge.

@azeemhassni
Copy link

azeemhassni commented Nov 3, 2016

Faced the same bug and can confirm this fixes it. Please merge it on priority bases

@santhoshnsscoe
Copy link

I think this is not the correct way to solve this problem.
Currently they are taken the least price product id from the query. It is a problem if the least product is out of stock.
So, the solution is take the least product which is not out of stock. So, the query should include the in stock filter.
e.g. cataloginventory_stock_status with stock_status=1

@kiutisuperking
Copy link

kiutisuperking commented Nov 23, 2016

it only works if the first child is out of stock and other child products are in stock. If one of the children products (except the first one) is out of stock, this bug still exists.

@sitepodmatt
Copy link

sitepodmatt commented Nov 24, 2016

Does anyone know if this issue is being tracked "internally"? (..ah the joys of open source/community)

@skovalenk
Copy link
Contributor

Hi everyone. @sitepodmatt yes issue is tracked internally with id MAGETWO-60703. @nissablagojevic can you try to resolve conflicts

Thanks

@nissablagojevic
Copy link
Author

Ok, so I feel like I probably messed up this PR by merging upstream. Also those Travis CI checks that failed aren't even my work, so not sure how to proceed from here at all. @sereban

@sitepodmatt
Copy link

Hi nissablagojevic,

Best way imho would be to reset your branch nissablagojevic/configurable_get_subproduct to c2e1480c0e71ae50cfd938942630533a5f0a7e4c to begin.

git clean -fd
git reset --hard c2e1480c0e71ae50cfd938942630533a5f0a7e4c

Then ensure your develop branch is up-to-date with the latest big dump of "tracked internally" changes/fix dropped on the 6th.. I am presuming that the repo you have for origin is not magento2/magento but your own fork so let's add another origin

git remote add upstream https://github.com/magento/magento2.git
git fetch upstream
git checkout develop
git merge upstream/develop

Then your develop branch should be on 732d445

Then switch back to nissablagojevic/configurable_get_subproduct and do:
git rebase develop

This should then replay your changes on top of latest develop branch.

You will have to force push up to configurable_get_subproduct since history has been rewritten.

Alt, start a new branch off develop and cherry-pick c2e1480c0e71ae50cfd938942630533a5f0a7e4c although rebasing is a better habit to get in if chasing the progress of develop with your own "tracked internally" fixes

@staffrob
Copy link

Hi @nissablagojevic,
Were you able to get this working? I can't see which files to modify anymore.
If you could point me in the right direction, I would much appreciate it :)

…Builders and a limit of PHP_INT_MAX to ConfigurableOptionsProvider
@nissablagojevic nissablagojevic force-pushed the configurable_get_subproducts branch from ade2a22 to 0b8581c Compare December 21, 2016 10:58
@nissablagojevic
Copy link
Author

Because you asked so nicely @staffrob and thanks to @sitepodmatt for providing such great instructions on how to fix my repo, I've just fixed it up for you. You can see the relevant files in the latest commit. :) Please note I especially have no idea how well this will work with 2.1.3, although I've experienced no repercussions yet in 2.1.2

@staffrob
Copy link

Thanks very much @nissablagojevic! Much appreciated!

Unfortunately this has no effect in 2.1.3, only now the prices of products with out of stock configurable option show as $0 on the frontend.

@okorshenko
Copy link
Contributor

@nissablagojevic thank you for PR. Could you please resolve conflicts so that we can proceed with PR acceptance. Thank you

@okorshenko
Copy link
Contributor

Closing this PR due to inactivity

@okorshenko okorshenko closed this Apr 20, 2017
@okorshenko okorshenko added this to the April 2017 milestone Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.