From 559d85f0f4efd896eabe1408028ecf5691ce134f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 16 Jun 2022 01:28:19 +0200 Subject: [PATCH] Remove redundant error message used sometimes when switching The API error messages already explain everything well enough, we pass them directly into a very similar popup in #loadFail. This message is older than the pretty API error responses, and didn't work with them well. Bug: T306763 Change-Id: Ie0d8dc24c967cce02579d6c0539a55ba14372f84 --- extension.json | 6 ++---- i18n/ve-mw/en.json | 1 - i18n/ve-mw/qqq.json | 1 - .../ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 7 +------ 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/extension.json b/extension.json index f6183f6cc7..f4fc013799 100644 --- a/extension.json +++ b/extension.json @@ -817,8 +817,7 @@ "visualeditor-savedialog-title-preview", "visualeditor-savedialog-title-review", "visualeditor-savedialog-title-save", - "visualeditor-savedialog-warning-dirty", - "visualeditor-serializeerror" + "visualeditor-savedialog-warning-dirty" ], "targets": [ "desktop", @@ -869,8 +868,7 @@ "visualeditor-savedialog-identify-anon", "visualeditor-savedialog-identify-trylogin", "visualeditor-savedialog-identify-user", - "visualeditor-saveerror", - "visualeditor-serializeerror" + "visualeditor-saveerror" ], "targets": [ "desktop", diff --git a/i18n/ve-mw/en.json b/i18n/ve-mw/en.json index e6fe71b96d..013637594a 100644 --- a/i18n/ve-mw/en.json +++ b/i18n/ve-mw/en.json @@ -403,7 +403,6 @@ "visualeditor-saveerror": "Error saving data to server: $1.", "visualeditor-section-body-placeholder": "New section", "visualeditor-section-title-placeholder": "Subject", - "visualeditor-serializeerror": "Error loading data from server: $1.", "visualeditor-loaderror-revidconflict": "Revision IDs returned by the server do not match (document: $1, metadata: $2).", "visualeditor-loaderror-wrongmode": "Tried to load the editor in wrong mode (data type: \"$1\", editor mode: \"$2\").", "visualeditor-settings-tool": "Page settings", diff --git a/i18n/ve-mw/qqq.json b/i18n/ve-mw/qqq.json index 194df86f6d..c208f843cc 100644 --- a/i18n/ve-mw/qqq.json +++ b/i18n/ve-mw/qqq.json @@ -423,7 +423,6 @@ "visualeditor-saveerror": "Text shown when the editor fails to save properly.\n\nParameters:\n* $1 is an error message, in English.", "visualeditor-section-body-placeholder": "Placeholder for surface when adding a new section", "visualeditor-section-title-placeholder": "Placeholder for title input when adding a new section\n{{Identical|Subject}}", - "visualeditor-serializeerror": "Text shown when the editor fails to load the wikitext for saving.\n\nParameters:\n* $1 is an error message, in English.", "visualeditor-loaderror-revidconflict": "Error message shown when loading the editor.\n\nParameters:\n* $1 and $2: revision IDs, as numbers", "visualeditor-loaderror-wrongmode": "Error message shown when loading the editor.\n\nParameters:\n* $1 and $2: names for editing modes (not translateable)", "visualeditor-settings-tool": "Text of tool in the toolbar the lets users set specific page settings.\n{{Identical|Page settings}}", diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index 1898260a4b..cc9697f9e5 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -879,12 +879,7 @@ ve.init.mw.DesktopArticleTarget.prototype.serialize = function () { return promise.fail( function ( error, response ) { var $errorMessages = target.extractErrorMessages( response ); - OO.ui.alert( - $( ve.htmlMsg( - 'visualeditor-serializeerror', - $( '' ).append( $errorMessages )[ 0 ] - ) ) - ); + OO.ui.alert( $errorMessages ); // It's possible to get here while the save dialog has never been opened (if the user uses // the switch to source mode option)