diff --git a/api/webapp/extPatches/ext4-patches.js b/api/webapp/extPatches/ext4-patches.js index a81239777c8..5cff5a9cf32 100644 --- a/api/webapp/extPatches/ext4-patches.js +++ b/api/webapp/extPatches/ext4-patches.js @@ -446,6 +446,23 @@ Ext4.override(Ext4.data.Store, { } }); +/** + * Delayed query/type-ahead tasks and remote load callbacks can fire after onDestroy has nulled the store. + * Cancel the tasks on destroy; a remote load's callback isn't a task, so guard it. + */ +Ext4.override(Ext4.form.field.ComboBox, { + onDestroy: function() { + this.doQueryTask.cancel(); + if (this.typeAheadTask) + this.typeAheadTask.cancel(); + this.callParent(arguments); + }, + afterQuery: function() { + if (!this.isDestroyed) + this.callParent(arguments); + } +}); + /** * RowExpander plugin is not properly configured to handle sandboxed ExtJS. */ diff --git a/core/src/client/components/DynamicConfigurationModal.tsx b/core/src/client/components/DynamicConfigurationModal.tsx index 323b9b0d345..9c9b67ea6cc 100644 --- a/core/src/client/components/DynamicConfigurationModal.tsx +++ b/core/src/client/components/DynamicConfigurationModal.tsx @@ -61,6 +61,7 @@ export default class DynamicConfigurationModal extends PureComponent { const { modalType, authConfig, configType, closeModal, updateAuthRowsAfterSave } = this.props; + this.setState({ errorMessage: '' }); if (this.areRequiredFieldsEmpty()) { return; } @@ -98,6 +99,7 @@ export default class DynamicConfigurationModal extends PureComponent { // Issue 50964: Save incomplete disabled authentication configurations if (!this.state.fieldValues.enabled) { + this.setState({ emptyRequiredFields: [] }); return false; } @@ -110,12 +112,8 @@ export default class DynamicConfigurationModal extends PureComponent this.state.fieldValues[name] == ''); - if (emptyRequiredFields.length > 0) { - this.setState({ emptyRequiredFields }); - return true; - } else { - return false; - } + this.setState({ emptyRequiredFields }); + return emptyRequiredFields.length > 0; }; onToggle = (): void => {