+ $info['id'] = Sanitizer::escapeIdForAttribute( "{$this->mID}--$key--$fieldname" );
+ }
+ // Copy the hide-if rules to "child" fields, so that the JavaScript code handling them
+ // (resources/src/mediawiki/htmlform/hide-if.js) doesn't have to handle nested fields.
+ if ( $this->mHideIf ) {
+ if ( isset( $info['hide-if'] ) ) {
+ // Hide child field if either its rules say it's hidden, or parent's rules say it's hidden
+ $info['hide-if'] = [ 'OR', $info['hide-if'], $this->mHideIf ];
+ } else {
+ // Hide child field if parent's rules say it's hidden
+ $info['hide-if'] = $this->mHideIf;
+ }