Make HTMLForm::formatErrors non-static to can parse message in context
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 13 Dec 2014 11:08:45 +0000 (12:08 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 19 Dec 2014 15:31:55 +0000 (16:31 +0100)
One call in core already called it non-static

Avoid:
[GlobalTitleFail] MessageCache::parse called by
Message::toString/Message::parseText/MessageCache::parse with no title
set

Change-Id: Ic91e715177c0a4578825640a31ec68ecba3176e0

includes/htmlform/HTMLForm.php
includes/specials/SpecialBlock.php

index df805aa..dc73522 100644 (file)
@@ -1015,7 +1015,7 @@ class HTMLForm extends ContextSource {
         *
         * @return string HTML, a "<ul>" list of errors
         */
-       public static function formatErrors( $errors ) {
+       public function formatErrors( $errors ) {
                $errorstr = '';
 
                foreach ( $errors as $error ) {
@@ -1029,7 +1029,7 @@ class HTMLForm extends ContextSource {
                        $errorstr .= Html::rawElement(
                                'li',
                                array(),
-                               wfMessage( $msg, $error )->parse()
+                               $this->msg( $msg, $error )->parse()
                        );
                }
 
index 14d97eb..deb8b0d 100644 (file)
@@ -105,7 +105,7 @@ class SpecialBlock extends FormSpecialPage {
 
                # Don't need to do anything if the form has been posted
                if ( !$this->getRequest()->wasPosted() && $this->preErrors ) {
-                       $s = HTMLForm::formatErrors( $this->preErrors );
+                       $s = $form->formatErrors( $this->preErrors );
                        if ( $s ) {
                                $form->addHeaderText( Html::rawElement(
                                        'div',