-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed
Description
Preconditions
- Magento 2.2.4 without sample data is installed
- Multiple root categories are added (3)
- Multiple subcategories added to each root category (2 each)
Steps to reproduce
- In Admin, navigate to Marketing-Catalog Price Rule
- Add a new rule
- Under conditions, add a condition and select Category
- Click on the ... link
- Click the open chooser button
Expected result
- Category checkbox tree loads
Actual result
- Category checkbox tree fails to load and script enters an endless loop
After some digging, it appears as though the issue may be in the following file -vendor/magento/module-catalog/view/adminhtml/web/js/category-checkbox-tree.js line 164
categoryLoader.buildCategoryTree = function (parent, config) {// eslint-disable-line no-shadow
if (!config) {
return null;
}
if (parent && config && config.length) {
for (i = 0; i < config.length; i++) {
categoryLoader.processCategoryTree(parent, config, i);
}
}
};
The counter in the for loop will get a config.length equal to the number of root categories, but will not increment past the number of subcategories contained in the root category.
Metadata
Metadata
Assignees
Labels
Issue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed