jenkins-bot has submitted this change and it was merged.
Change subject: Do not allow empty html when saving or publishing
......................................................................
Do not allow empty html when saving or publishing
This can cause loss of previous translations, if previous content
is replaced with empty string, possibly caused by JavaScript error.
Also no point creating new, empty drafts.
Change-Id: Id51618611e7eb120e2ab4c64c43241a85d0a46e2
---
M api/ApiContentTranslationPublish.php
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Santhosh: Looks good to me, approved
jenkins-bot: Verified
diff --git a/api/ApiContentTranslationPublish.php
b/api/ApiContentTranslationPublish.php
index c776152..70a8367 100644
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -155,6 +155,10 @@
$this->dieUsage( 'Invalid target language',
'invalidtargetlanguage' );
}
+ if ( trim( $params['html'] ) === '' ) {
+ $this->dieUsage( 'html cannot be empty', 'invalidhtml'
);
+ }
+
if ( $params['status'] === 'draft' ) {
$this->saveAsDraft();
} else {
--
To view, visit https://gerrit.wikimedia.org/r/204057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id51618611e7eb120e2ab4c64c43241a85d0a46e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits