Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Blocker
-
Resolution: Cannot Reproduce
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:php 5.3 / symfony 1.3
Description
Hi there.
This a bug related with Symfony but I think the problem comes from Doctrine so I post it here.
When trying to update an object with this array:
{{
var_dump($values)
array
'id' => string '14' (length=2)
'foo' => null
'bar_relation' =>
array
'id' => string '15' (length=2)
'title' => string '' (length=0)
'bar_other_relation' =>
array
'id' => string '16' (length=2)
'title' => string '' (length=0)
}}
When calling
{{
$object->fromArray($values):
}}
I'l have this error message:
{{
Call to a member function getTable() on a non-object in [...]/Doctrine/Record.php on line 1511.
}}
And the stack trace
{{
sfFormDoctrine->doSave( ) ../sfFormDoctrine.class.php:218
sfFormDoctrine->updateObject( ) ../sfFormDoctrine.class.php:415
sfFormDoctrine->doUpdateObject( ) ../sfFormDoctrine.class.php:249
Doctrine_Record->fromArray( ) ../sfFormDoctrine.class.php:267
MyModel->setBarRelation( ) ../Record.php:1923
sfDoctrineRecord->__call( ) ../sfDoctrineRecord.class.php:0
call_user_func_array ( ) ../sfDoctrineRecord.class.php:204
Doctrine_Record->set( ) ../sfDoctrineRecord.class.php:0
Doctrine_Record->_set( ) ../Record.php:1382
Doctrine_Record->coreSetRelated( ) ../Record.php:1426
}}
Doctrine_Record->coreSetRelated is called with an array instead of a proper Doctrine_Record, and Doctrine try to call ->getTable on this array, causing the error.
Is this a symfony problem or a doctrine one?
When I try and reproduce this in a test case with your example it doesn't behave that way. Can you try and make a failing test case for us to look at?