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

Fixed non existant category with products issue #311

Open
wants to merge 1 commit into
base: 2.3-develop
from

Conversation

Projects
None yet
4 participants
@ldusan84
Copy link
Contributor

ldusan84 commented Jan 3, 2019

Description (*)

The category query for category that doesn't exist with products count shouldn't throw an error.

Fixed Issues (if relevant)

  1. #310: Non existent category with products query results in an error

Manual testing scenarios (*)

  1. Query:
{
  category(id: 99) {
    product_count
  }
}
  1. Result
{
  "data": {
    "category": null
  }
}

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
@magento-cicd2

This comment has been minimized.

Copy link
Contributor

magento-cicd2 commented Jan 3, 2019

CLA assistant check
All committers have signed the CLA.

@@ -72,7 +72,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
$rootCategoryId = $this->getCategoryId($args);
$categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId);
if (!empty($categoriesTree)) {
if (!empty($categoriesTree) && ($categoriesTree->count() > 0)) {

This comment has been minimized.

@SikailoISM

SikailoISM Jan 15, 2019

Contributor

if (!empty($categoriesTree) && $categoriesTree->count()) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment