swafsarl
(Info)
January 3, 2011, 2:43am
1
In version 1.1.5
file "CFormInputElement.php"
Line 153
public function render()
{
if($this->type==='hidden')
return $this->renderInput();
$output=array(
'{label}'=>$this->renderLabel(),
'{input}'=>$this->renderInput(),
'{hint}'=>$this->renderHint(),
'{error}'=>$this->getParent()->showErrorSummary ? '' : $this->renderError(), //<--here
);
return strtr($this->layout,$output);
}
should be
'{error}'=>$this->getParent()->showErrorSummary ? $this->renderError() : '', //<--here
swafsarl
(Info)
January 3, 2011, 2:53am
2
In version 1.1.5
public function render()
{
if($this->type==='hidden')
return $this->renderInput();
$output=array(
'{label}'=>$this->renderLabel(),
'{input}'=>$this->renderInput(),
'{hint}'=>$this->renderHint(),
'{error}'=>$this->getParent()->showErrorSummary ? '' : $this->renderError(), //<--here
);
return strtr($this->layout,$output);
}
should be
'{error}'=>$this->getParent()->showErrorSummary ? $this->renderError() : '', //<--here
Please confirm that the correction ive made is correct
The error kept me from using the renderBody methos of Cform, with the correction everything is fine!!
mdomba
(Maurizio Domba Cerin)
January 3, 2011, 7:46am
3
Good catch… the correnction is good… fixed in trunk - http://code.google.com/p/yii/source/detail?r=2803
mdomba
(Maurizio Domba Cerin)
January 3, 2011, 1:26pm
4
Ops… it’s not a bug… it’s by design… see the comment of Qiang - http://code.google.com/p/yii/source/detail?r=2803
swafsarl
(Info)
January 3, 2011, 1:47pm
5
ok
but in this case what makes "getActiveFormWidget()" return null when using renderBody() instead of render();
public function renderError()
{
$parent=$this->getParent();
return $parent->getActiveFormWidget()->error($parent->getModel(), $this->name, $this->errorOptions);
}