#1545: Record filters fail when property value is NULL
-----------------------------------+----------------------------------------
Reporter: adamthehutt | Owner: romanb
Type: defect | Status: new
Priority: major | Milestone: 1.0.3
Component: Record | Version: 1.0.2
Keywords: filter | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
Record filters fail when the property being accessed has a value of NULL.
{{{
class Foo extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('a', 'string');
}
public function setUp()
{
$this->unshiftFilter(new FooFilter());
}
}
class FooFilter extends Doctrine_Record_Filter
{
public function filterGet(Doctrine_Record $record, $name)
{
if($name == 'b')
{
return NULL;
}
}
}
$foo = new Foo();
var_dump($foo->b);
Expected:
NULL
Actual:
Doctrine_Record_Exception is thrown because property/relation "b" doesn't
exist on Foo
}}}
I've traced the problem to line 980 in the Doctrine_Record class file:
if (($value = $filter->filterGet($this, $fieldName, $value)) !== null)
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1545>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---