From ef6cb32920bf53e516cc17099ad0e7d178b1e5d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Wed, 25 May 2016 20:04:41 +0000 Subject: [PATCH] Restore Userlogin error/warning URL parameter I accidentally removed this when rewriting for AuthManager. Also change an ID into a CSS class for now since HTMLInfoField does not support IDs. Bug: T135775 Change-Id: I5663a02c9809dd573087a4a528702c949b938970 --- includes/specialpage/LoginSignupSpecialPage.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/includes/specialpage/LoginSignupSpecialPage.php b/includes/specialpage/LoginSignupSpecialPage.php index 0e4252c9e8..bd6b08f9c2 100644 --- a/includes/specialpage/LoginSignupSpecialPage.php +++ b/includes/specialpage/LoginSignupSpecialPage.php @@ -825,7 +825,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { array $requests, array $fieldInfo, array &$formDescriptor, $action ) { $coreFieldDescriptors = $this->getFieldDefinitions( $this->fakeTemplate ); - $specialFields = array_merge( [ 'extraInput', 'linkcontainer' ], + $specialFields = array_merge( [ 'extraInput', 'linkcontainer', 'entryError' ], array_keys( $this->fakeTemplate->getExtraInputDefinitions() ) ); // keep the ordering from getCoreFieldDescriptors() where there is no explicit weight @@ -1027,8 +1027,8 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { 'linkcontainer' => [ // help link 'type' => 'info', - 'cssclass' => 'mw-form-related-link-container', - 'id' => 'mw-userlogin-help', + 'cssclass' => 'mw-form-related-link-container mw-userlogin-help', + // 'id' => 'mw-userlogin-help', // FIXME HTMLInfoField ignores this 'raw' => true, 'default' => Html::element( 'a', [ 'href' => Skin::makeInternalOrExternalUrl( wfMessage( 'helplogin-url' ) @@ -1055,6 +1055,17 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { // 'required' => true, ]; + if ( $this->mEntryError ) { + $fieldDefinitions['entryError'] = [ + 'type' => 'info', + 'default' => Html::rawElement( 'div', [ 'class' => $this->mEntryErrorType . 'box', ], + $this->mEntryError ), + 'raw' => true, + 'rawrow' => true, + 'weight' => -100, + ]; + } + if ( !$this->showExtraInformation() ) { unset( $fieldDefinitions['linkcontainer'] ); } -- 2.20.1