X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fhtmlform%2Ffields%2FHTMLUserTextField.php;h=12c09c1d7e71d57662443d105a13f52d9e8d7fbb;hb=9964ca1a390c446397dcd466916ffed356cdc3c9;hp=5a7e0b9b854a136950b30613230d9fd9110aa8a0;hpb=1cdd4682ed43ffe4d95597e54836189ca974404b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/fields/HTMLUserTextField.php b/includes/htmlform/fields/HTMLUserTextField.php index 5a7e0b9b85..12c09c1d7e 100644 --- a/includes/htmlform/fields/HTMLUserTextField.php +++ b/includes/htmlform/fields/HTMLUserTextField.php @@ -28,23 +28,29 @@ 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 ); } + protected function shouldInfuseOOUI() { + 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' );