From: Happy-melon Date: Wed, 15 Dec 2010 20:10:16 +0000 (+0000) Subject: Follow-up r78445: validation errors would never be shown on a GET form X-Git-Tag: 1.31.0-rc.0~33281 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=ca0e1a0ff0bee1d600eb6083144b5a43b7c28095;p=lhc%2Fweb%2Fwiklou.git Follow-up r78445: validation errors would never be shown on a GET form --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index cd3dc1ff3d..d1a5438ff5 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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 );