#1701: doctrine:data-load does not load product of NestedSet data-dump without
children
-----------------------------------+----------------------------------------
Reporter: dao | Owner: jwage
Type: defect | Status: new
Priority: major | Milestone: 1.0.5
Component: Import/Export | Version: 1.0.3
Keywords: NestedSet | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 1
-----------------------------------+----------------------------------------
I'm using sfDoctrinePlugin with symfony 1.2RC2 under windows/PHP 5.2.4,
but the error is in Doctrine Core.
I dumped a simple NestedSet (fixture and schema attached) with:
{{{
symfony doctrine:data-dump
}}}
and then tried to reload it with:
{{{
symfony doctrine:build-all-reload
}}}
My NestedSet data was not loaded.
I found that Doctrine_Data_Import::_loadData looks for a 'children'
property on $data if its class is a Tree. If so, it loads $data through
Doctrine_Data_Import::_buildNestedSetRows. If not - as in my case - it
loads through Doctrine_Data_Import::_buildRows. Later on in _loadData,
there's another check to see if the data is from a tree, and if NOT, it's
saved through $obj->save() (286-288). Because the data IS a tree and NOT
included in $nestedSets, nothing happens.
The attached patch just removes the second check for isTree() from
_loadData, and everything appears to work insofar as I'm able to
manipulate the tree through sfDoctrineNestedSetManager and the contents of
my NestedSet table are identical before and after the reload.
I'm not sure why my data is dumped the way that it is, instead of with the
'children' property which seems to be how nestedSets are supposed to be
exported.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1701>
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
-~----------~----~----~----~------~----~------~--~---