Merge "Skin: Make skins aware of their registered skin name"
[lhc/web/wiklou.git] / includes / htmlform / OOUIHTMLForm.php
index ed99802..1755e98 100644 (file)
@@ -66,7 +66,10 @@ class OOUIHTMLForm extends HTMLForm {
                        }
 
                        if ( isset( $this->mSubmitTooltip ) ) {
-                               $attribs += Linker::tooltipAndAccesskeyAttribs( $this->mSubmitTooltip );
+                               $attribs += [
+                                       'title' => Linker::titleAttrib( $this->mSubmitTooltip ),
+                                       'accessKey' => Linker::accesskey( $this->mSubmitTooltip ),
+                               ];
                        }
 
                        $attribs['classes'] = [ 'mw-htmlform-submit' ];
@@ -173,11 +176,17 @@ class OOUIHTMLForm extends HTMLForm {
         * @return string HTML
         */
        protected function formatSection( array $fieldsHtml, $sectionName, $anyFieldHasLabel ) {
+               if ( !$fieldsHtml ) {
+                       // Do not generate any wrappers for empty sections. Sections may be empty if they only have
+                       // subsections, but no fields. A legend will still be added in wrapFieldSetSection().
+                       return '';
+               }
+
                $config = [
                        'items' => $fieldsHtml,
                ];
                if ( $sectionName ) {
-                       $config['id'] = Sanitizer::escapeId( $sectionName );
+                       $config['id'] = Sanitizer::escapeIdForAttribute( $sectionName );
                }
                if ( is_string( $this->mWrapperLegend ) ) {
                        $config['label'] = $this->mWrapperLegend;