You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/12/14 15:18:12 UTC

[sling-org-apache-sling-app-cms] branch SLING-8919-fix-error-dialog created (now 078e3a6)

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a change to branch SLING-8919-fix-error-dialog
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git.


      at 078e3a6  Adding initial crack at fixing SLING-8919

This branch includes the following new commits:

     new 078e3a6  Adding initial crack at fixing SLING-8919

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-app-cms] 01/01: Adding initial crack at fixing SLING-8919

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch SLING-8919-fix-error-dialog
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit 078e3a68ce4c6ae8a9acac7a261e3327366d8c6c
Author: Dan Klco <dk...@apache.org>
AuthorDate: Sat Dec 14 10:17:33 2019 -0500

    Adding initial crack at fixing SLING-8919
---
 ui/src/main/frontend/js/cms.js    | 2 +-
 ui/src/main/frontend/js/editor.js | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ui/src/main/frontend/js/cms.js b/ui/src/main/frontend/js/cms.js
index 6130912..1e88feb 100644
--- a/ui/src/main/frontend/js/cms.js
+++ b/ui/src/main/frontend/js/cms.js
@@ -71,7 +71,7 @@
                         window.top.location.reload();
                     });
                 } else {
-                    Sling.CMS.ui.confirmMessage(msg, res.title, function () {
+                    Sling.CMS.ui.confirmMessage(msg, res ? res.title : '', function () {
                         Sling.CMS.ui.reloadContext();
                     });
                 }
diff --git a/ui/src/main/frontend/js/editor.js b/ui/src/main/frontend/js/editor.js
index d09eadb..bff4680 100644
--- a/ui/src/main/frontend/js/editor.js
+++ b/ui/src/main/frontend/js/editor.js
@@ -179,13 +179,15 @@
                                     }
                                 }).then(function (response) {
                                     if (!response.ok) {
-                                        throw new Error(response.statusText);
+                                        throw new Error(response.json());
                                     }
                                     return response.json();
                                 }).catch(function (error) {
-                                    ui.confirmMessage(error.message, error.message, function () {});
+                                    ui.confirmMessage('Failed to move', 'Failed to move: '+error, function () {});
                                 }).then(function (res) {
-                                    ui.confirmReload(res, 'success');
+                                    if(res){
+                                        ui.confirmReload(res, 'success');
+                                    }
                                 });
                                 evt.target.classList.remove('sling-cms-droptarget__is-over');
                             }