Skip to content

Commit

Permalink
Fix bug property 'id' of undefined [PR#466]
Browse files Browse the repository at this point in the history
Fix bug `property 'id' of undefined` #466
  • Loading branch information
Ibochkarev committed Nov 10, 2020
2 parents 01f434e + ba131f8 commit a95072f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions assets/components/minishop2/js/mgr/category/category.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Ext.extend(miniShop2.panel.Category, MODx.panel.Resource, {
item.getState = function () {
return {activeTab: this.items.indexOf(this.getActiveTab())};
};
var pageSettingsTab, accessPermissionsTab;
for (var i2 in item.items) {
if (!item.items.hasOwnProperty(i2)) {
continue;
Expand All @@ -35,16 +36,17 @@ Ext.extend(miniShop2.panel.Category, MODx.panel.Resource, {
}
else if (tab.id == 'modx-page-settings') {
tab.items = this.getCategorySettings(config);
var pageSettingsTab = tab;
pageSettingsTab = tab;
item.items.splice(i2, 1);
}
else if (tab.id == 'modx-resource-access-permissions') {
var accessPermissionsTab = tab;
accessPermissionsTab = tab;
item.items.splice(i2, 1);
}
}
// Move the "Settings" and "Resource Groups" to the end of tabs
item.items.push(pageSettingsTab, accessPermissionsTab);
pageSettingsTab && item.items.push(pageSettingsTab);
accessPermissionsTab && item.items.push(accessPermissionsTab);
}
if (item.id != 'modx-resource-content') {
fields.push(item);
Expand Down Expand Up @@ -166,4 +168,4 @@ Ext.extend(miniShop2.panel.Category, MODx.panel.Resource, {
},

});
Ext.reg('minishop2-panel-category', miniShop2.panel.Category);
Ext.reg('minishop2-panel-category', miniShop2.panel.Category);

0 comments on commit a95072f

Please sign in to comment.