Skip to content

Unable to load category checkbox tree #16140

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

Closed
jwcarder opened this issue Jun 14, 2018 · 1 comment
Closed

Unable to load category checkbox tree #16140

jwcarder opened this issue Jun 14, 2018 · 1 comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@jwcarder
Copy link

Preconditions

  1. Magento 2.2.4 without sample data is installed
  2. Multiple root categories are added (3)
  3. Multiple subcategories added to each root category (2 each)

Steps to reproduce

  1. In Admin, navigate to Marketing-Catalog Price Rule
  2. Add a new rule
  3. Under conditions, add a condition and select Category
  4. Click on the ... link
  5. Click the open chooser button

Expected result

  1. Category checkbox tree loads

Actual result

  1. 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.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jun 14, 2018
@hostep
Copy link
Contributor

hostep commented Jun 14, 2018

Hi @jwcarder

I'm going to close this issue as it duplicates #15121, which already got fixed in #15265 (d9dc66c) and the fix should get included in Magento 2.2.5

@hostep hostep closed this as completed Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

3 participants