Preference views do not need the master DB.
Change-Id: Id0c3fc6d453b6af0eca8450107da6d554c822347
$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' ] );