Fix output of form

Let showForm() add the form to the output instead of execute(), because showForm() is also called in doSubmit() when there is an error, in which case it didn't actually show the form, so now it does. This was in fact a regression of r92636.

Change-Id: Ib6f0df50ce8e0c45e32817c70e4e1bc649cdf177
This commit is contained in:
robin 2012-05-26 01:51:14 +02:00
parent 33a8e1d9eb
commit 2b7e4575f7

View file

@ -43,7 +43,7 @@ class SpecialInterwiki extends SpecialPage {
case 'edit':
case 'add':
if ( $this->canModify( $out ) ) {
$out->addHTML( $this->showForm( $action ) );
$this->showForm( $action );
}
$out->returnToMain( false, $return );
break;
@ -98,7 +98,6 @@ class SpecialInterwiki extends SpecialPage {
/**
* @param $action string
* @return string
*/
function showForm( $action ) {
$request = $this->getRequest();
@ -120,7 +119,7 @@ class SpecialInterwiki extends SpecialPage {
if ( !$row ) {
$this->error( 'interwiki_editerror', $prefix );
return '';
return;
}
$prefix = $row->iw_prefix;
@ -160,7 +159,7 @@ class SpecialInterwiki extends SpecialPage {
);
}
return Xml::fieldset( $topmessage, Html::rawElement( 'form',
$form = Xml::fieldset( $topmessage, Html::rawElement( 'form',
array( 'id' => "mw-interwiki-{$action}form", 'method' => 'post',
'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ),
Html::rawElement( 'p', null, $intromessage ) .
@ -179,6 +178,8 @@ class SpecialInterwiki extends SpecialPage {
Html::hidden( 'wpInterwikiAction', $action )
)
) );
$this->getOutput()->addHTML( $form );
return;
}
function doSubmit() {