On Sat, Aug 7, 2010 at 11:48 AM, nick <nkhan....@gmail.com> wrote:
> This seems very basic but I am trying the "blog" example line by
> line.
> I am using Cake version 1.3.3
>
> When I try the add post basically adding functionality to add the
> post, everything works fine until I try to save the new record.
> I get the error - Fatal error: Cannot access empty property in /home/
> nick/www/blog/cake/libs/model/model.php on line 978
>
> I looked further and found on model.php#978 access like this -
>
>  $this->{$model}
>
> Now removing braces and $ worked!  i.e.
>  $this->model is fine without any errors.
>
> This is not the right fix, I know because $this->model is not even set
> but the property access itself was a problem before.
>
> Not sure if this is PHP4 / PHP5 difference, but I assumed Cake 1.3.3
> works on PHP5.
>
> Any insight will be highly appreciated. The server that I am using is
> -
> Apache/2.0.54 (Ubuntu) PHP/5.0.5-2ubuntu1.8
>
> Thanks in advance

Perhaps it's a problem with your DB schema. The $model var should be
the name of the model, as passed to the method, eg. 'Post.title'. The
list($model, $column) = explode('.', $column); line is where the
$model var should be populated. If that's empty then it's likely that
$column doesn't include the model name for some reason.

Try adding debug($column) or die(debug($column)) just before and after
this line:

$column = str_replace(array($db->startQuote, $db->endQuote), '', $column);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to