Merge "Update email mute copy on preferences page"
[lhc/web/wiklou.git] / includes / htmlform / OOUIHTMLForm.php
index e47de61..1755e98 100644 (file)
@@ -176,6 +176,12 @@ 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,
                ];