As an addition to this, I have another bit of wierdness that might
seem obvious to some but if you do $form->save() on a new  object you
want to place in a nested set BEFORE you try to do $obj-
>insertAsLAstChildOf($parent) or any other tree insertion stuff it
sets the tree data it on the object but when you save it after the
insertAs.... the tree valules become NULL.

You need to do $obj= $form->getObject() then $obj-
>insertAsLAstChildOf($parent). THEN $obj->save().

It appears that once you've saved an object into the table with null
tree data then the behavior can't work it out when you try to save it.
No error gets thrown.

Is this how it should work?
Seems a bit odd to me.

TW

On Apr 29, 6:58 pm, Tofuwarrior <p...@clearintent.co.uk> wrote:
> This is just a note to save someone a headache.
>
> I couldn't get the propel 1.5 nested sets insert and add functions to
> work. They wouldn't throw an error but on save the left, right and
> level fields would blank and null values would be in the db. adChild,
> iinsertAsXChild etc etc none of these worked.
>
> After hours of tearing my hair out I've worked out that it was because
> in my fixtures file I had started at level 1 for my root objects and
> worked up.
>
> MAKE SURE YOU ASSIGN LEVEL = 0 for your root objects, it all works
> fine if you do this. Iif your root is level 1 then you don't get
> errors or anything when you save and the read functions seemed to work
> fine but it won't save the tree data.
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

Reply via email to