Legoktm has submitted this change and it was merged.

Change subject: Make HTMLForm::formatErrors non-static to can parse message in 
context
......................................................................


Make HTMLForm::formatErrors non-static to can parse message in context

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
---
M includes/htmlform/HTMLForm.php
M includes/specials/SpecialBlock.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index df805aa..dc73522 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -1015,7 +1015,7 @@
         *
         * @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 @@
                        $errorstr .= Html::rawElement(
                                'li',
                                array(),
-                               wfMessage( $msg, $error )->parse()
+                               $this->msg( $msg, $error )->parse()
                        );
                }
 
diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index 14d97eb..deb8b0d 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -105,7 +105,7 @@
 
                # 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',

-- 
To view, visit https://gerrit.wikimedia.org/r/179597
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic91e715177c0a4578825640a31ec68ecba3176e0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to