Fixed uninitialized wcfDialog
authormutec <mutec@users.noreply.github.com>
Sun, 22 Feb 2015 23:41:46 +0000 (00:41 +0100)
committermutec <mutec@users.noreply.github.com>
Sun, 22 Feb 2015 23:41:46 +0000 (00:41 +0100)
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

index 784175bd0dc1e389fdacfc90e744b0d864cca140..45c4395981622d1f1ae87e574f4d33e64e4402a5 100644 (file)
@@ -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 = $('<div />').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