From 74cde0740811f992df1466ffd94e217e3aa1f034 Mon Sep 17 00:00:00 2001 From: mutec Date: Mon, 23 Feb 2015 00:41:46 +0100 Subject: [PATCH] Fixed uninitialized wcfDialog Fixed error using an uninitialized wcfDialog when no purchased products are found and auth data are stored within the packageserver see also https://community.woltlab.com/thread/233253-api-error-bei-gekaufte-produkte-plugin-store/?postID=1418941#post1418941 --- wcfsetup/install/files/acp/js/WCF.ACP.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index 784175bd0d..45c4395981 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -1687,9 +1687,16 @@ WCF.ACP.PluginStore.PurchasedItems.Search = Class.extend({ } else if (data.returnValues.noResults) { // there are no purchased products yet - this._dialog.wcfDialog('option', 'title', WCF.Language.get('wcf.acp.pluginStore.purchasedItems')); - this._dialog.html(data.returnValues.noResults); - this._dialog.wcfDialog('open'); + if (this._dialog === null) { + this._dialog = $('
').hide().appendTo(document.body); + this._dialog.html(data.returnValues.noResults).wcfDialog({ + title: WCF.Language.get('wcf.acp.pluginStore.purchasedItems') + }); + } else { + this._dialog.wcfDialog('option', 'title', WCF.Language.get('wcf.acp.pluginStore.purchasedItems')); + this._dialog.html(data.returnValues.noResults); + this._dialog.wcfDialog('open'); + } } else if (data.returnValues.noSSL) { // PHP was compiled w/o OpenSSL support -- 2.20.1