Georggi199 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/326325 )
Change subject: Made sure publisher is listed, if there is only one ...................................................................... Made sure publisher is listed, if there is only one Bug: T152168 Change-Id: Ifc259349f7e6090161de4f2f5ee0cd05e6460c59 --- M includes/content/NewsletterContent.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/25/326325/1 diff --git a/includes/content/NewsletterContent.php b/includes/content/NewsletterContent.php index 666aa29..a7d0f65 100644 --- a/includes/content/NewsletterContent.php +++ b/includes/content/NewsletterContent.php @@ -102,7 +102,7 @@ protected function getPublishersFromJSONData( $publishersList ) { // Ask for confirmation before removing all the publishers if ( count( $publishersList ) === 0 ) { - return Status::newFatal( 'newsletter-manage-no-publishers' ); + Status::newFatal( 'newsletter-manage-no-publishers' ); } $publishers = []; @@ -111,7 +111,7 @@ $user = User::newFromName( $publisherName ); if ( !$user || !$user->getId() ) { // Input contains an invalid username - return Status::newFatal( 'newsletter-manage-invalid-publisher', $publisherName ); + Status::newFatal( 'newsletter-manage-invalid-publisher', $publisherName ); } $publishers[] = $user->getId(); } @@ -167,7 +167,7 @@ 'default' => $options->getUserLangObj()->formatNum( $this->newsletter->getSubscriberCount() ), ), ); - if ( count( $this->getPublishersFromJSONData( $this->publishers ) ) > 1 ) { + if ( count( $this->getPublishersFromJSONData( $this->publishers ) ) > 0 ) { // Have this here to avoid calling unneeded functions $this->doLinkCacheQuery( $this->getPublishersFromJSONData( $this->publishers ) ); $fields['publishers']['default'] = $this->buildUserList( $this->getPublishersFromJSONData( $this->publishers ) ); -- To view, visit https://gerrit.wikimedia.org/r/326325 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc259349f7e6090161de4f2f5ee0cd05e6460c59 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Georggi199 <bmp2...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits