Skip to content

Commit b2ecc62

Browse files
committed
ACP2E-3131: [Cloud] Anchor/Non-Anchor Categories Reversed in Content Widget
- Fix for default category
1 parent dc1001d commit b2ecc62

File tree

1 file changed

+12
-0
lines changed
  • app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget

1 file changed

+12
-0
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
123123
// Create the new node and execute node callback
124124
data.instance.create_node(childNode, newNode, 'last', node => {
125125
if (useMassAction) {
126+
isAnchorArr[parseInt(node.id)] = node.original.is_anchor;
126127
if (checkedNodes.includes(node.id)) {
127128
tree.jstree(true).select_node(node.id);
128129
}
@@ -159,6 +160,17 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
159160
}
160161
});
161162
}
163+
else if (childNode.children.length === 0
164+
&& childNode.original && childNode.original.lastNode) {
165+
if (useMassAction) {
166+
isAnchorArr[parseInt(childNode.id)] = childNode.original.is_anchor;
167+
if (checkedNodes.includes(childNode.id)) {
168+
tree.jstree(true).select_node(childNode.id);
169+
}
170+
getCheckedNodeIds(tree, childNode);
171+
actionBasedOnIsAnchorOnly();
172+
}
173+
}
162174
})
163175
}
164176
}

0 commit comments

Comments
 (0)