I got the blank rendered page and checked apache error log and saw this entry
[Tue Jun 01 19:19:55 2010] [error] [client 10.0.0.26] PHP Fatal error: Call to a member function getErrors() on a non-object in /home/dmtrs/public_html/yii/framework/web/helpers/CHtml.php on line 1529
this happen before i
$form->errorSummary($person);
if i
var_dump($person);
just before i get the object.
Has anybody any idea???
Did not had the time to search for related issues will do later.
cyberpol
(Cyberpol 777)
June 1, 2010, 4:52pm
2
the error says that $form is not an object.
zitter
(Zitter)
June 1, 2010, 5:32pm
3
paste controller action and the view
The corect files are to my next post
mdomba
(Maurizio Domba Cerin)
June 2, 2010, 7:45am
5
From what I see…
In the update.php you call the _form.php with
<?php echo $this->renderPartial('_form', array('person'=>$person,'address'=>$address, 'update'=>true)); ?>
no ‘model’=>…
and in the _form.php you use a variable $model instead of $person or $adress
Sorry paste it wrong view
this is the proper one.
View/_form.php
Controller
view/update.php
mdomba
(Maurizio Domba Cerin)
June 2, 2010, 8:48am
7
Now
In your question you have
$form->errorSummary($person);
but in the source code you have
echo $form->errorSummary(array($person,$address));
and here $address is an array - not an object!
mdomba:
Now
In your question you have
$form->errorSummary($person);
but in the source code you have
echo $form->errorSummary(array($person,$address));
and here $address is an array - not an object!
firstly if i remove the errorSummary line nothing happens either.
I have chnaged render to this in update action :
$this->render('update',array(
'person'=>$person,
'address'=>$mainaddress,
));
mdomba
(Maurizio Domba Cerin)
June 2, 2010, 9:33am
9
At least there should not be the error "call to a member function getErrors() on a non-object"…
I noticed that in the update.php you have echo renderpartial… so you need renderpartial to return it’s value not to echo it…
check the renderpartial $return parameter - http://www.yiiframework.com/doc/api/CController#renderPartial-detail
you should set it to true, by default is false and renderpartial returns null in that case…
tydeas_dr
(Tydeas Dr)
June 2, 2010, 10:56am
10
Found the problem was that $address==null when calling
xaineekhan
(F Ghafoor54)
January 9, 2012, 2:30pm
11
i had the same problem i replaced forms with CHtml and solved