X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFormElement.php;h=fbef2651f6695c6a4283d39f26f8935e2e2ceda3;hb=138298b397b308ad6e4bfc7088884d90e8ac1e37;hp=66d6143329a586b7e8a18fc45d40f96506f0aa19;hpb=4ad03aa11dacd2f443105e43fd1429398aa73bdc;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 ) ] );