From f3fb553a11325b43715a8861e790cd3cb6574052 Mon Sep 17 00:00:00 2001 From: Steven Choi Date: Thu, 21 Sep 2023 12:49:42 +1000 Subject: [PATCH 1/2] #658 Error when saving comments --- .../profileEditor/controllers/CommentController.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js b/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js index 06301df8..6d9960ee 100644 --- a/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js +++ b/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js @@ -66,6 +66,7 @@ profileEditor.controller('CommentController', function (profileService, util, co messageService.success("Comment successfully saved."); var comment = null; + if (self.currentComment.uuid) { comment = find(path); comment.text = self.currentComment.text; @@ -76,6 +77,9 @@ profileEditor.controller('CommentController', function (profileService, util, co } comment.children.push(data); } else { + if (!Array.isArray(self.comments)) { + self.comments = []; + } self.comments.push(data); } From 3d334b2278b7ee63c9411782361cb78d1a408ecb Mon Sep 17 00:00:00 2001 From: Steven Choi Date: Thu, 21 Sep 2023 12:51:59 +1000 Subject: [PATCH 2/2] #658 Error when saving comments --- .../javascripts/profileEditor/controllers/CommentController.js | 1 - 1 file changed, 1 deletion(-) diff --git a/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js b/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js index 6d9960ee..f1fd17ab 100644 --- a/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js +++ b/grails-app/assets/javascripts/profileEditor/controllers/CommentController.js @@ -66,7 +66,6 @@ profileEditor.controller('CommentController', function (profileService, util, co messageService.success("Comment successfully saved."); var comment = null; - if (self.currentComment.uuid) { comment = find(path); comment.text = self.currentComment.text;