Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / includes / specialpage / FormSpecialPage.php
index f727c05..42c5980 100644 (file)
@@ -89,11 +89,18 @@ abstract class FormSpecialPage extends SpecialPage {
         * @return HTMLForm|null
         */
        protected function getForm() {
-               $this->fields = $this->getFormFields();
-
-               $form = HTMLForm::factory( $this->getDisplayFormat(), $this->fields, $this->getContext(), $this->getMessagePrefix() );
+               $form = HTMLForm::factory(
+                       $this->getDisplayFormat(),
+                       $this->getFormFields(),
+                       $this->getContext(),
+                       $this->getMessagePrefix()
+               );
                $form->setSubmitCallback( array( $this, 'onSubmit' ) );
-               $form->setWrapperLegendMsg( $this->getMessagePrefix() . '-legend' );
+               if ( $this->getDisplayFormat() !== 'ooui' ) {
+                       // No legend and wrapper by default in OOUI forms, but can be set manually
+                       // from alterForm()
+                       $form->setWrapperLegendMsg( $this->getMessagePrefix() . '-legend' );
+               }
 
                $headerMsg = $this->msg( $this->getMessagePrefix() . '-text' );
                if ( !$headerMsg->isDisabled() ) {