X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fhtmlform%2Ffields%2FHTMLInfoField.php;h=a98f11289deb0b8530360cd55bd28c2c227dec0c;hb=b703c2408e649285bb363133b548fa1c45978a0b;hp=6dc5d08091c3121af8fd4ca8216f0b5f80eb879a;hpb=695481aa3f3f72e617aacdef8aefeecf9d79f996;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/fields/HTMLInfoField.php b/includes/htmlform/fields/HTMLInfoField.php index 6dc5d08091..ab59ff0343 100644 --- a/includes/htmlform/fields/HTMLInfoField.php +++ b/includes/htmlform/fields/HTMLInfoField.php @@ -19,10 +19,10 @@ class HTMLInfoField extends HTMLFormField { parent::__construct( $info ); } - function getDefault() { + public function getDefault() { $default = parent::getDefault(); if ( $default instanceof Closure ) { - $default = call_user_func( $default, $this->mParams ); + $default = $default( $this->mParams ); } return $default; } @@ -75,6 +75,23 @@ class HTMLInfoField extends HTMLFormField { return parent::getRaw( $value ); } + /** + * @param mixed $value If not FieldLayout or subclass has been deprecated. + * @return OOUI\FieldLayout + * @since 1.32 + */ + public function getOOUI( $value ) { + if ( !empty( $this->mParams['rawrow'] ) ) { + if ( !( $value instanceof OOUI\FieldLayout ) ) { + wfDeprecated( __METHOD__ . ": 'default' parameter as a string when using" . + "'rawrow' (must be a FieldLayout or subclass)", '1.32' ); + } + return $value; + } + + return parent::getOOUI( $value ); + } + protected function needsLabel() { return false; }