Pwirth has submitted this change and it was merged.

Change subject: Checklist: Fallback list options when list template is corrupt
......................................................................


Checklist: Fallback list options when list template is corrupt

When the list template indicated in checklist tag does not point to
an actual wiki page, display a "-" as the only list option. This resolves
an issue where the BlueSpice Visual Editor would not load when the list
template could not be resolved.

Change-Id: I521c791b994a57d2a9c5c7a70053304b481aaeae
---
M Checklist/resources/bluespice.checklist.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Pwirth: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Checklist/resources/bluespice.checklist.js 
b/Checklist/resources/bluespice.checklist.js
index 9462f21..c081d24 100644
--- a/Checklist/resources/bluespice.checklist.js
+++ b/Checklist/resources/bluespice.checklist.js
@@ -65,7 +65,11 @@
                        }] ),
                        async: false, //TODO: Reimplement with aysnc call
                        success: function(response){
-                               BsChecklist.optionsLists[listId] = 
response.results[0].listOptions;
+                               if (response.results.length > 0 ) {
+                                       BsChecklist.optionsLists[listId] = 
response.results[0].listOptions;
+                               } else {
+                                       BsChecklist.optionsLists[listId] = 
["-"];
+                               }
                        }
                });
 

-- 
To view, visit https://gerrit.wikimedia.org/r/285147
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I521c791b994a57d2a9c5c7a70053304b481aaeae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to