X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialPreferences.php;h=f00477f7f273b7a6937777c19552caa2918d116f;hb=c2e2afbc900dda1228f8ea6f5a3609d569fce00a;hp=7f257e65e4227ed3d6d5022377de1ef4402a9017;hpb=6e9b4f0e9ce4ccd6089c18b205065ef7fa077484;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 7f257e65e4..f00477f7f2 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -57,24 +57,29 @@ class SpecialPreferences extends SpecialPage { if ( $request->getSessionData( 'specialPreferencesSaveSuccess' ) ) { // Remove session data for the success message $request->setSessionData( 'specialPreferencesSaveSuccess', null ); + $out->addModuleStyles( 'mediawiki.notification.convertmessagebox.styles' ); - $out->wrapWikiMsg( + $out->addHtml( Html::rawElement( 'div', [ - 'class' => 'mw-preferences-messagebox successbox', - 'id' => 'mw-preferences-success' + 'class' => 'mw-preferences-messagebox mw-notify-success successbox', + 'id' => 'mw-preferences-success', + 'data-mw-autohide' => 'false', ], - Html::element( 'p', [], '$1' ) - ), - 'savedprefs' + Html::element( 'p', [], $this->msg( 'savedprefs' )->text() ) + ) ); } $this->addHelpLink( 'Help:Preferences' ); // Load the user from the master to reduce CAS errors on double post (T95839) - $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser(); + if ( $this->getRequest()->wasPosted() ) { + $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser(); + } else { + $user = $this->getUser(); + } $htmlForm = Preferences::getFormObject( $user, $this->getContext() ); $htmlForm->setSubmitCallback( [ 'Preferences', 'tryUISubmit' ] );