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

[Inventory] Availability checker must check that variant was not deleted #1930

Merged
merged 1 commit into from
Sep 23, 2014

Conversation

stloyd
Copy link
Contributor

@stloyd stloyd commented Sep 23, 2014

Fixes #1813.

@stloyd
Copy link
Contributor Author

stloyd commented Sep 23, 2014

@pjedrzejewski @Arn0d @umpirsky What do you think?

@@ -42,7 +43,11 @@ public function __construct($backorders)
*/
public function isStockAvailable(StockableInterface $stockable)
{
if (true === $this->backorders || $stockable->isAvailableOnDemand()) {
if ($stockable instanceof SoftDeletableInterface && $stockable->isDeleted()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isDeleted() method is not defined in StockableInterface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why this checks for SoftDeletableInterface ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

@stloyd Oh, blind me, sorry.

pjedrzejewski pushed a commit that referenced this pull request Sep 23, 2014
[Inventory] Availability checker must check that variant was not deleted
@pjedrzejewski pjedrzejewski merged commit 8b61d06 into Sylius:master Sep 23, 2014
@pjedrzejewski
Copy link
Member

Thanks Joseph! 👍

@stloyd stloyd deleted the bugfix/inventory_check branch September 23, 2014 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleted variant show up in selection matching
3 participants