Skip to content

Commit

Permalink
minor #450 fix product not assigned to channel error message (CSchulz)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

I was wondering why querying an existing product results into a channel not found error.

(Could be possible that there will be some test failures, I will fix them soon).

Commits
-------

94f6c96 fix product not assigned to channel error message
  • Loading branch information
mamazu authored Jun 8, 2019
2 parents 1a0b40f + 94f6c96 commit 31b2ca0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function findOneByCode(string $productCode, string $channelCode, ?string
$product = $this->productRepository->findOneByCode($productCode);

Assert::notNull($product, sprintf('Product with code %s has not been found.', $productCode));
Assert::true($product->hasChannel($channel), sprintf('Channel with code %s has not been found.', $channelCode));
Assert::true($product->hasChannel($channel), sprintf('Product with code %s has not been found for channel %s.', $productCode, $channelCode));

return $this->productViewFactory->create($product, $channel, $localeCode);
}
Expand Down

0 comments on commit 31b2ca0

Please sign in to comment.