Merge "Fix EventRelayerKafka IDEA errors"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 22 Apr 2016 20:05:24 +0000 (20:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 22 Apr 2016 20:05:24 +0000 (20:05 +0000)
includes/htmlform/HTMLForm.php
includes/htmlform/OOUIHTMLForm.php
includes/htmlform/VFormHTMLForm.php

index 2b6a0aa..6f88975 100644 (file)
@@ -1146,10 +1146,12 @@ class HTMLForm extends ContextSource {
                        }
                }
 
-               $html = Html::rawElement( 'span',
-                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+               if ( !$buttons ) {
+                       return '';
+               }
 
-               return $html;
+               return Html::rawElement( 'span',
+                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
        }
 
        /**
index 4f8365e..278d453 100644 (file)
@@ -121,10 +121,12 @@ class OOUIHTMLForm extends HTMLForm {
                        ] + $attrs );
                }
 
-               $html = Html::rawElement( 'div',
-                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+               if ( !$buttons ) {
+                       return '';
+               }
 
-               return $html;
+               return Html::rawElement( 'div',
+                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
        }
 
        protected function wrapFieldSetSection( $legend, $section, $attributes ) {
index c446615..f3cba48 100644 (file)
@@ -137,9 +137,11 @@ class VFormHTMLForm extends HTMLForm {
                        $buttons .= Html::element( 'input', $attrs ) . "\n";
                }
 
-               $html = Html::rawElement( 'div',
-                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+               if ( !$buttons ) {
+                       return '';
+               }
 
-               return $html;
+               return Html::rawElement( 'div',
+                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
        }
 }