X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFormElement.php;h=fbef2651f6695c6a4283d39f26f8935e2e2ceda3;hb=35f00337816ed66a7ca8bb6eeb5fccf422ee4e1a;hp=66d6143329a586b7e8a18fc45d40f96506f0aa19;hpb=3b7f4539639b3899e246e245df481882f81f9340;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLFormElement.php b/includes/htmlform/HTMLFormElement.php index 66d6143329..fbef2651f6 100644 --- a/includes/htmlform/HTMLFormElement.php +++ b/includes/htmlform/HTMLFormElement.php @@ -1,7 +1,7 @@ hideIf = isset( $config['hideIf'] ) ? $config['hideIf'] : null; - $this->modules = isset( $config['modules'] ) ? $config['modules'] : []; + $this->hideIf = $config['hideIf'] ?? null; + $this->modules = $config['modules'] ?? []; // Initialization if ( $this->hideIf ) { $this->addClasses( [ 'mw-htmlform-hide-if' ] ); } if ( $this->modules ) { - // JS code must be able to read this before infusing (before OOjs UI is even loaded), + // JS code must be able to read this before infusing (before OOUI is even loaded), // so we put this in a separate attribute (not with the rest of the config). // And it's not needed anymore after infusing, so we don't put it in JS config at all. $this->setAttributes( [ 'data-mw-modules' => implode( ',', $this->modules ) ] );