Bug Report #4420
ORM with belongs_to causes error when setting it to NULL
| Status: | New | Start date: | 01/27/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | Kohana v3.x - v3.2.1 | |||
| Resolution: | Points: | 1 |
Description
Reported in the forums: http://forum.kohanaframework.org/discussion/10125/
Setting a belongs_to relationship to NULL results in an error because the pk() method is being called on $value while it is NULL.
Kohana_ORM::set() (orm.php line 675):
$this->_object[$this->_belongs_to[$column]['foreign_key']] = $value->pk();