Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions manager/assets/modext/widgets/core/modx.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,9 @@ Ext.extend(MODx.grid.GridBase, Ext.grid.EditorGridPanel, {
}
const
{ record } = this.menu,
saveParams = this.config.saveParams || {},
// Clone — mutating config.saveParams leaks remove action/key into later
// autosave UpdateFromGrid payloads (#14280).
Comment thread
Ibochkarev marked this conversation as resolved.
Outdated
saveParams = Ext.apply({}, this.config.saveParams || {}),
primaryKey = this.config.primaryKey || 'id'
;
text = text || 'confirm_remove';
Expand All @@ -1580,8 +1582,11 @@ Ext.extend(MODx.grid.GridBase, Ext.grid.EditorGridPanel, {
},

removeActiveRow: function(record) {
if (this.fireEvent('afterRemoveRow', record)) {
const selection = this.getSelectionModel().getSelected();
if (!this.fireEvent('afterRemoveRow', record)) {
return;
}
const selection = this.getSelectionModel().getSelected();
if (selection) {
this.getStore().remove(selection);
}
Comment thread
Ibochkarev marked this conversation as resolved.
Outdated
},
Expand Down
4 changes: 4 additions & 0 deletions manager/assets/modext/widgets/core/modx.grid.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ MODx.grid.SettingsGrid = function(config = {}) {
}
},
afterRemoveRow: function() {
// Reload filters + grid. Return false so removeActiveRow does not also
// store.remove(selection) — that races the refresh and can drop another
// row, so later edit/delete hits setting_err_nf (#14280).
Comment thread
Ibochkarev marked this conversation as resolved.
Outdated
this.refreshFilterOptions(gridFilterData);
return false;
Comment thread
Ibochkarev marked this conversation as resolved.
Outdated
}
});

Expand Down
Loading