jenkins-bot has submitted this change and it was merged.
Change subject: Parse SpamBlacklist error on the server-side
......................................................................
Parse SpamBlacklist error on the server-side
The client won't be able to deal with templates etc.
Bug: T99830
Change-Id: I78611a3f061b1afd73de052aa9ddff48dc368f2d
---
M ApiVisualEditorEdit.php
M extension.json
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
3 files changed, 8 insertions(+), 6 deletions(-)
Approvals:
Jforrester: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php
index 2be476a..0ba2790 100644
--- a/ApiVisualEditorEdit.php
+++ b/ApiVisualEditorEdit.php
@@ -158,6 +158,13 @@
'edit' => $saveresult['edit']
);
+ if ( isset( $saveresult['edit']['spamblacklist'] ) ) {
+ $matches = explode( '|',
$saveresult['edit']['spamblacklist'] );
+ $matcheslist =
$this->getLanguage()->listToText( $matches );
+ $result['edit']['sberrorparsed'] = $this->msg(
'spamprotectiontext' )->parse() . ' ' .
+ $this->msg( 'spamprotectionmatch',
$matcheslist )->parse();
+ }
+
// Success
} else {
if ( isset( $saveresult['edit']['newrevid'] ) ) {
diff --git a/extension.json b/extension.json
index be20ff6..2d42647 100644
--- a/extension.json
+++ b/extension.json
@@ -319,8 +319,6 @@
"lastmodifiedat",
"parentheses",
"redirectpagesub",
- "spamprotectionmatch",
- "spamprotectiontext",
"summary-preview",
"fancycaptcha-reload-text",
"visualeditor-loadwarning",
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 0912968..b31b641 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -695,10 +695,7 @@
*/
ve.init.mw.ViewPageTarget.prototype.onSaveErrorSpamBlacklist = function (
editApi ) {
this.showSaveError(
- ve.msg( 'spamprotectiontext' ) + ' ' +
- ve.msg(
- 'spamprotectionmatch', mw.language.listToText(
editApi.spamblacklist.split( '|' ) )
- ),
+ $( $.parseHTML( editApi.sberrorparsed ) ),
false // prevents reapply
);
};
--
To view, visit https://gerrit.wikimedia.org/r/221867
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I78611a3f061b1afd73de052aa9ddff48dc368f2d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits