preferences: Preserve Status from saveFormData() in submitForm()

The old Preference::tryUISubmit() and the new submitForm() would
blissfully return Status::newGood(), even when it isn't good.

Bug: T191933
Change-Id: I4e35c5a71800f88b2063dd0361d83a56f54d58c3
This commit is contained in:
Alexia E. Smith 2018-04-10 17:20:20 -05:00 committed by Timo Tijhof
parent df240f9537
commit 7b2182d9e5

View file

@ -1724,9 +1724,8 @@ class DefaultPreferencesFactory implements PreferencesFactory {
protected function submitForm( array $formData, PreferencesForm $form ) {
$res = $this->saveFormData( $formData, $form );
if ( $res ) {
if ( $res === true ) {
$context = $form->getContext();
$urlOptions = [];
if ( $res === 'eauth' ) {
@ -1750,7 +1749,7 @@ class DefaultPreferencesFactory implements PreferencesFactory {
$context->getOutput()->redirect( $url );
}
return Status::newGood();
return ( $res === true ? Status::newGood() : $res );
}
/**