From: Thiemo Mättig Date: Wed, 4 May 2016 13:29:24 +0000 (+0200) Subject: Fix HTMLFormField calling Message::setContext with null X-Git-Tag: 1.31.0-rc.0~7107 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=30aaec7b506e38ae628bbfd3b133bf43d58f12c1;p=lhc%2Fweb%2Fwiklou.git 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 --- 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; } /**