This repository was archived by the owner on Dec 19, 2019. It is now read-only.
Fix regexp when filter by root category id#121
Merged
magento-engcom-team merged 10 commits intomagento:2.3-developfrom Oct 4, 2018
Merged
Fix regexp when filter by root category id#121magento-engcom-team merged 10 commits intomagento:2.3-developfrom
magento-engcom-team merged 10 commits intomagento:2.3-developfrom
Conversation
Contributor
naydav
reviewed
Jul 19, 2018
| $level = $this->levelCalculator->calculate($rootCategoryId); | ||
|
|
||
| // If root category is being filter, we've to remove first slash | ||
| if ($rootCategoryId == 1) { |
Contributor
There was a problem hiding this comment.
Looks like we need to use \Magento\Catalog\Model\Category::TREE_ROOT_ID instead of 1
Contributor
Author
There was a problem hiding this comment.
that's exactly what I didn't found when I did that fix..
awesome! I will be pushing the update
Contributor
Author
|
@naydav welcome back! |
added 2 commits
October 1, 2018 13:36
-- fix coupling between object in CategoryTree
-- fix static tests
Contributor
added 4 commits
October 1, 2018 14:03
-- fix static tests
-- fix static tests
…ee-root-regexp # Conflicts: # app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php
-- fixes after mainline merge
magento-engcom-team
pushed a commit
that referenced
this pull request
Oct 4, 2018
This was referenced Oct 4, 2018
magento-engcom-team
pushed a commit
that referenced
this pull request
May 31, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
At present, if you query the category tree requesting the Root Category (
id = 1), query returns empty.This is caused by the regular expression that filters the
catalog_category_entity.pathcolumn table, which includes for all cases, a slash (/) at the beginning.In the case of the Root Category, there's no slash at the beginning.
This has been tested for this scenarios:
Root Categorycreated post install.For all cases, in the
catalog_category_entity.pathcolumn table, categories are always created as a1/children.Fixed Issues (if relevant)
Fixed issue: No issue created to this PR.
Issue related: Category tree depth calculation issue #100
Manual testing scenarios
To be able to test this PR, you have to first apply the PR #102, which fixes the category deph
childrenparam.category(id: 1), to get the entire CategoryRoot Categorywith all the children.Query the Root Category
Expected result
Actual result
Contribution checklist