Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / includes / htmlform / fields / HTMLUserTextField.php
index f21b53d..12c09c1 100644 (file)
@@ -28,20 +28,18 @@ class HTMLUserTextField extends HTMLTextField {
                $user = User::newFromName( $value, false );
 
                if ( !$user ) {
-                       return $this->msg( 'htmlform-user-not-valid', $value )->parse();
+                       return $this->msg( 'htmlform-user-not-valid', $value );
                } elseif (
                        ( $this->mParams['exists'] && $user->getId() === 0 ) &&
                        !( $this->mParams['ipallowed'] && User::isIP( $value ) )
                ) {
-                       return $this->msg( 'htmlform-user-not-exists', $user->getName() )->parse();
+                       return $this->msg( 'htmlform-user-not-exists', $user->getName() );
                }
 
                return parent::validate( $value, $alldata );
        }
 
        protected function getInputWidget( $params ) {
-               $this->mParent->getOutput()->addModules( 'mediawiki.widgets.UserInputWidget' );
-
                return new UserInputWidget( $params );
        }
 
@@ -49,6 +47,10 @@ class HTMLUserTextField extends HTMLTextField {
                return true;
        }
 
+       protected function getOOUIModules() {
+               return [ 'mediawiki.widgets.UserInputWidget' ];
+       }
+
        public function getInputHtml( $value ) {
                // add the required module and css class for user suggestions in non-OOUI mode
                $this->mParent->getOutput()->addModules( 'mediawiki.userSuggest' );