Follow-up r78445: validation errors would never be shown on a GET form
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 15 Dec 2010 20:10:16 +0000 (20:10 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 15 Dec 2010 20:10:16 +0000 (20:10 +0000)
includes/HTMLForm.php

index cd3dc1f..d1a5438 100644 (file)
@@ -595,6 +595,10 @@ class HTMLForm {
        public function setMethod( $method='post' ){
                $this->mMethod = $method;
        }
+       
+       public function getMethod(){
+               return $this->mMethod;
+       }
 
        /**
         * TODO: Document
@@ -850,7 +854,7 @@ abstract class HTMLFormField {
                        $verticalLabel = true;
                }
 
-               if ( $errors === true || !$wgRequest->wasPosted() ) {
+               if ( $errors === true || ( !$wgRequest->wasPosted() && ( $this->mParent->getMethod() == 'post' ) ) ) {
                        $errors = '';
                } else {
                        $errors = Html::rawElement( 'span', array( 'class' => 'error' ), $errors );