X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fhtmlform%2Ffields%2FHTMLUserTextField.php;h=12c09c1d7e71d57662443d105a13f52d9e8d7fbb;hp=f21b53d91ed3b38824b7ea38a88b841d6f7accc2;hb=9964ca1a390c446397dcd466916ffed356cdc3c9;hpb=c5a186ebf13e32641afb6bd9048a1ddc17fdcf6f diff --git a/includes/htmlform/fields/HTMLUserTextField.php b/includes/htmlform/fields/HTMLUserTextField.php index f21b53d91e..12c09c1d7e 100644 --- a/includes/htmlform/fields/HTMLUserTextField.php +++ b/includes/htmlform/fields/HTMLUserTextField.php @@ -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' );