jenkins-bot has submitted this change and it was merged.

Change subject: Making title-params no longer required.
......................................................................


Making title-params no longer required.

In theory, a notification could not need any contextual information
so there's no reason we should make it required.

Now, if the title-params are not provided in the notifcation
definition, it just sets the value to an empty array.

Change-Id: Iba5ce5cc56010101c5e64976c95b37a215dc99fa
---
M formatters/BasicFormatter.php
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Matthias Mullie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/formatters/BasicFormatter.php b/formatters/BasicFormatter.php
index 3eaa97a..70c3e20 100644
--- a/formatters/BasicFormatter.php
+++ b/formatters/BasicFormatter.php
@@ -41,8 +41,7 @@
         * @param array
         */
        protected $requiredParameters = array (
-               'title-message',
-               'title-params'
+               'title-message'
        );
 
        /**
@@ -57,14 +56,14 @@
        public function __construct( $params ) {
                parent::__construct( $params );
 
+               // Set up default params if any are missing
+               $params += $this->getDefaultParams();
+
                // Title for archive page
                $this->title = array(
                        'message' => $params['title-message'],
                        'params' => $params['title-params']
                );
-
-               // Set up default params if one is missing
-               $params += $this->getDefaultParams();
 
                // Title for the flyout
                $this->flyoutTitle = array(
@@ -108,6 +107,7 @@
         */
        protected function getDefaultParams() {
                return array(
+                       'title-params' => array(),
                        'flyout-message' => $this->title['message'],
                        'flyout-params' => $this->title['params'],
                        'bundle-message' => '',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iba5ce5cc56010101c5e64976c95b37a215dc99fa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Kaldari <rkald...@wikimedia.org>
Gerrit-Reviewer: Bsitu <bs...@wikimedia.org>
Gerrit-Reviewer: EBernhardson (WMF) <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to