diff --git a/assets/components/importx/js/mgr/widget.home.form.js b/assets/components/importx/js/mgr/widget.home.form.js index 2aa608c..17c8d23 100644 --- a/assets/components/importx/js/mgr/widget.home.form.js +++ b/assets/components/importx/js/mgr/widget.home.form.js @@ -31,21 +31,23 @@ importX.page.createImport = function(config) { process: 'import', text: _('importx.startbutton'), handler: function() { - if (this.console === null || typeof this.console === 'undefined') { - this.console = MODx.load({ - xtype: 'modx-console' - ,register: register - ,topic: topic - ,show_filename: 0 - ,listeners: { - 'shutdown': {fn:function() { - Ext.getCmp('modx-layout').refreshTrees(); - },scope:this} - } - }); - } else { - this.console.setRegister(register, topic); + // Destroy any previously loaded console, so we can load a fresh one without errors. + if (typeof this.console !== 'undefined') { + this.console.destroy(); } + + this.console = MODx.load({ + xtype: 'modx-console' + ,register: register + ,topic: topic + ,show_filename: 0 + ,listeners: { + 'shutdown': {fn:function() { + Ext.getCmp('modx-layout').refreshTrees(); + },scope:this} + } + }); + this.console.show(Ext.getBody()); Ext.getCmp('importx-panel-import').form.submit({ success:{fn:function() {