Description
When returning an error from creation/edition, the front end Publish Dialog does its best to show the most relevant string that identifies the error.
However, with some errors, the persistence layer returns Z509/List of errors, which wraps a typed list of Z5 with the different encountered errors.
In such cases, the Publish Dialog is showing "list of errors" instead of showing a list of the error messages.
Steps to reproduce:
- Go to create function page: https://wikifunctions.beta.wmflabs.org/w/index.php?title=Special:CreateObject&zid=Z8
- To force this behavior, create a function with clashing labels. For example create a function that has the same names as https://wikifunctions.beta.wmflabs.org/wiki/Z10014
- English - "And"
- Swedish - "Och"
- Click "Publish" and proceed to the final publish step:
Observed behavior:
- Publishing returns the following error:
- However, the returned object can be inspected on the browser "Network" details:
{ "error": { "code": "wikilambda-zerror", "info": "Error of type Z509", "message": "List of errors", "zerror": { "Z1K1": "Z5", "Z5K1": "Z509", "Z5K2": { "Z1K1": { "Z1K1": "Z7", "Z7K1": "Z885", "Z885K1": "Z509" }, "K1": ["Z5", { "Z1K1": "Z5", "Z5K1": "Z554", "Z5K2": { "Z1K1": { "Z1K1": "Z7", "Z7K1": "Z885", "Z885K1": "Z554" }, "K1": { "Z1K1": "Z6", "Z6K1": "Z10014" }, "K2": { "Z1K1": "Z6", "Z6K1": "Z1002" } } }, { "Z1K1": "Z5", "Z5K1": "Z554", "Z5K2": { "Z1K1": { "Z1K1": "Z7", "Z7K1": "Z885", "Z885K1": "Z554" }, "K1": { "Z1K1": "Z6", "Z6K1": "Z10014" }, "K2": { "Z1K1": "Z6", "Z6K1": "Z1592" } } }] } }, "labelled": { "type": "Error", "error type": "List of errors", "error value": { "type": { "type": "Function call", "function": "Errortype to type", "errortype": "List of errors" }, "errors": ["Error", { "type": "Error", "error type": "Label for a given language clashes with another Object's label", "error value": { "type": { "type": "Function call", "function": "Errortype to type", "errortype": "Label for a given language clashes with another Object's label" }, "clashing ZID": { "type": "String", "value": "And" }, "language": { "type": "String", "value": "English" } } }, { "type": "Error", "error type": "Label for a given language clashes with another Object's label", "error value": { "type": { "type": "Function call", "function": "Errortype to type", "errortype": "Label for a given language clashes with another Object's label" }, "clashing ZID": { "type": "String", "value": "And" }, "language": { "type": "String", "value": "Swedish" } } }] } }, "*": "See https://wikifunctions.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes." }, "servedby": "deployment-mediawiki11" }
The list of errors inside "Z509" clearly shows two errors with significant information:
- Label for a given language clashes with another Object's label (chashing ZID: And, language: Swedish)
- Label for a given language clashes with another Object's label (chashing ZID: And, language: English)
It would be much more informative if such error rendered this simple message, which can at least transmit that there are 2 errors, and that the errors are label clashes:
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist