Adamw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/56894


Change subject: Fix: cloning a banner would have failed to clone the message 
fields Also, any error messages would not have been displayed to the user.
......................................................................

Fix: cloning a banner would have failed to clone the message fields
Also, any error messages would not have been displayed to the user.

Change-Id: I5922528a32ec8477797149055146c1f7e1f230af
---
M special/SpecialNoticeTemplate.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/94/56894/1

diff --git a/special/SpecialNoticeTemplate.php 
b/special/SpecialNoticeTemplate.php
index f4c1a20..7cc58c1 100644
--- a/special/SpecialNoticeTemplate.php
+++ b/special/SpecialNoticeTemplate.php
@@ -969,9 +969,8 @@
                $template_body = Revision::newFromTitle( $bodyPage )->getText();
 
                // Create new banner
-               if ( Banner::addTemplate( $dest, $template_body, 
$this->getUser(), $displayAnon, $displayAccount, $fundraising,
-                       $autolink, $landingPages )
-               ) {
+               $errors = Banner::addTemplate( $dest, $template_body, 
$this->getUser(), $displayAnon, $displayAccount, $fundraising, $autolink, 
$landingPages );
+               if ( !$errors ) {
 
                        // Populate the fields
                        foreach ( $langs as $lang => $fields ) {
@@ -980,6 +979,8 @@
                                }
                        }
                        return $dest;
+               } else {
+                       $this->showError( $errors );
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/56894
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5922528a32ec8477797149055146c1f7e1f230af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Adamw <awi...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to