-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: CatalogRuleFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasehelp wanted
Description
Preconditions
- M 2.1,4
Steps to reproduce
- Open form for create new Catalog Rule
- In Condition Select^ Product Attribute -> Category
- Open Categories Chooser
- Select one Category with level = 1, 2 or 3
- Select one Category with level > 3 (4, 5, ...)
- Click ok & close Category Chooser
- Open again Category Chooser and see
that only categories with level <= 3 are selected
and category with level > 3 without selection
Expected result
- All selected priviosly categories must be selected, with level > 3
Actual result
- Categories with level > 3 are not selected
PS
I used M2.1.,4, but checked 2.3 version and this bug is still present.
Categories with level <= 3 are generated with page with level > 3 with ajax request
For myself I fixed in file Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml
2. Added selected param to TreeLoader
3. Change Controller from CatalogRule/Controller/Adminhtml/Promo/Widget/CategoriesJson.php
to Catalog/Controller/Adminhtml/Category/Widget/CategoriesJson.php
which can work with selected param
3. After that everything is working
ps
diff
git diff magento/module-catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml
diff --git a/magento/module-catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml b/magento/module-catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml
index b1f81976..af1b9eb1 100644
--- a/magento/module-catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml
+++ b/magento/module-catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml
@@ -73,7 +73,7 @@ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
jQuery(function()
{
var categoryLoader = new Ext.tree.TreeLoader({
- dataUrl: '<?php /* @escapeNotVerified */ echo $block->getLoadTreeUrl() ?>'
+ dataUrl: '<?php /* @escapeNotVerified */ echo $block->getUrl('catalog/category_widget/categoriesJson') ?>'
});
categoryLoader.createNode = function(config) {
@@ -146,6 +146,7 @@ jQuery(function()
categoryLoader.on("beforeload", function(treeLoader, node) {
treeLoader.baseParams.id = node.attributes.id;
+ treeLoader.baseParams.selected = <?php /* @escapeNotVerified */ echo $block->getJsFormObject() ?>.updateElement.value;
});
categoryLoader.on("load", function(treeLoader, node, config) {
Metadata
Metadata
Assignees
Labels
Component: CatalogRuleFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasehelp wanted