Skip to content

Commit 852c69b

Browse files
committed
fix intermittent issues where this.data.id is not avaiable with category_selection alpine components
1 parent cdbd253 commit 852c69b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

view/adminhtml/templates/form/field_type/category_selection/main_js.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ $maxTreeLevel = $fieldType->getMaxCategoryLevel($fieldType->getCategoryTree());
237237
}
238238
},
239239
get itemId() {
240-
return this.data.id;
240+
return this.data?.id;
241241
},
242242
classInnerItem() {
243243
return { _parent: this.data.hasChildren };

view/adminhtml/templates/form/field_type/category_selection/search_input.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ use Magento\Framework\View\Element\Template;
122122
return {
123123
...CategorySelectItemCommon(),
124124
get itemId() {
125-
return this.data.id;
125+
return this.data?.id;
126126
},
127127
init() {
128128
this.$nextTick(() => {

0 commit comments

Comments
 (0)