Merge "Unify HTMLForm message handling"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 2 May 2016 20:52:46 +0000 (20:52 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 May 2016 20:52:46 +0000 (20:52 +0000)
1  2 
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLFormField.php
includes/htmlform/OOUIHTMLForm.php

Simple merge
@@@ -1095,25 -1095,6 +1095,16 @@@ abstract class HTMLFormField 
         * @return Message
         */
        protected function getMessage( $value ) {
-               if ( $value instanceof Message ) {
-                       return $value;
-               } elseif ( $value instanceof MessageSpecifier ) {
-                       return Message::newFromKey( $value );
-               } elseif ( is_array( $value ) ) {
-                       $msg = array_shift( $value );
-                       return $this->msg( $msg, $value );
-               } else {
-                       return $this->msg( $value, [] );
-               }
+               return Message::newFromSpecifier( $value )->setContext( $this->mParent );
        }
 +
 +      /**
 +       * Skip this field when collecting data.
 +       * @param WebRequest $request
 +       * @return bool
 +       * @since 1.27
 +       */
 +      public function skipLoadData( $request ) {
 +              return !empty( $this->mParams['nodata'] );
 +      }
  }
Simple merge