Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/94691
Change subject: Show an error to the user if the spamlist has no targets on it ...................................................................... Show an error to the user if the spamlist has no targets on it Bug: 53970 Change-Id: If406411c76abbe5847fa554e93ea2557a73e682b --- M MassMessage.i18n.php M SpecialMassMessage.php 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage refs/changes/91/94691/1 diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php index 992ab66..b12fbee 100644 --- a/MassMessage.i18n.php +++ b/MassMessage.i18n.php @@ -24,6 +24,7 @@ 'massmessage-submitted' => 'Your message delivery to {{PLURAL:$1|$1 page|$1 pages}} has been queued.', 'massmessage-just-preview' => 'This is just a preview. Press "{{int:massmessage-form-submit}}" to send the message.', 'massmessage-spamlist-doesnotexist' => 'The specified page-list page does not exist.', + 'massmessage-spamlist-notargets' => 'The specified page-list page does not have any targets on it.', 'massmessage-empty-subject' => 'The subject line is empty.', 'massmessage-empty-message' => 'The message body is empty.', 'massmessage-unescaped-langlinks' => 'Warning: There are unescaped language links in your message.', @@ -80,6 +81,7 @@ The spamlist is the page containing list of pages to leave a message on. This message probably means that said page, as provided by the user, does not exist.', + 'massmessage-spamlist-notargets' => 'Error message that the user sees if the page-list provided by the user has no targets listed on it.', 'massmessage-empty-subject' => 'Error message the user sees if the "subject" field is empty.', 'massmessage-empty-message' => 'Error message the user sees if the "message" field is empty.', 'massmessage-unescaped-langlinks' => 'Warning shown to user when previewing if their message text has unescaped language links.', diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php index 96962f3..00141e6 100644 --- a/SpecialMassMessage.php +++ b/SpecialMassMessage.php @@ -336,6 +336,12 @@ $this->status->fatal( $pages ); return $this->status; } + + if ( !$pages ) { + $this->status->fatal( 'massmessage-spamlist-notargets' ); + return $this->status; + } + $params = array( 'data' => $data, 'pages' => $pages ); $job = new MassMessageSubmitJob( $spamlist, $params ); JobQueueGroup::singleton()->push( $job ); -- To view, visit https://gerrit.wikimedia.org/r/94691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If406411c76abbe5847fa554e93ea2557a73e682b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassMessage Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits