-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[ProductAssociation] Show product associations within current channel only #14600
[ProductAssociation] Show product associations within current channel only #14600
Conversation
coldic3
commented
Dec 1, 2022
Q | A |
---|---|
Branch? | 1.11 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | fixes #14564 |
License | MIT |
f43ff14
to
04ecb6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we're missing a scenario where the associated product is available in a channel, but disabled.
src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_association.html.twig
Outdated
Show resolved
Hide resolved
…ions within current channel
04ecb6e
to
997e72d
Compare
src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductAssociationRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductAssociationRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductAssociationRepository.php
Outdated
Show resolved
Hide resolved
features/product/viewing_products/viewing_product_associations.feature
Outdated
Show resolved
Hide resolved
1e36dc1
to
6a7b453
Compare
Thank you, Kevin! 🥇 |
These changes contain a bug 😱!! The findWithProductsWithinChannel method should be allowed to return null: This is also suggested by the getOneOrNullResult() method in the Doctrine implementation. |
@lruozzi9 Thanks for catching it! Indeed returning null should be allowed. Interesting why static analysis didn't catch it 🤔 |
@coldic3 that's not the only problem. I now get the NotFoundHttpException from the findOr404 method while getting product associated from an empty association. Probably there is some error in the construction of the query. |
@lruozzi9 I see it! I did inner join instead of left join 🤦♂️ At first glance |
Right! 🤓😉 |
This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.11 | | Bug fix? | yes | | New feature? | no | | BC breaks? | no | | Deprecations? | no | | Related tickets | fixes #14600 | | License | MIT | See the discussion: #14600 (comment) Commits ------- 1cc8953 [ProductAssociation] Fix empty product associations