From 30aaec7b506e38ae628bbfd3b133bf43d58f12c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Wed, 4 May 2016 15:29:24 +0200 Subject: [PATCH] Fix HTMLFormField calling Message::setContext with null This is a hotfix. If you think it's better to revert I2e6195b instead please do so. Bug: T134351 Change-Id: Ifcc832a731b18933bdf6edfd6eb7a5cd6046c3ba --- includes/htmlform/HTMLFormField.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 380b11d441..9f5e72838b 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -28,7 +28,7 @@ abstract class HTMLFormField { protected $mShowEmptyLabels = true; /** - * @var HTMLForm + * @var HTMLForm|null */ public $mParent; @@ -1095,7 +1095,13 @@ abstract class HTMLFormField { * @return Message */ protected function getMessage( $value ) { - return Message::newFromSpecifier( $value )->setContext( $this->mParent ); + $message = Message::newFromSpecifier( $value ); + + if ( $this->mParent ) { + $message->setContext( $this->mParent ); + } + + return $message; } /** -- 2.20.1