Dear ahDoctrineEasyEmbeddedRelationsPlugin users,

oO, I just noticed something that's not good. :(

When I'm trying to add a new project (model object in my application,
just like in the README) the "add new" form for the related object
(repositories in my case) is also shown and adding both doesn't work,
obviously. Like Mikael pointed out, the id of the main object is not
there yet. So... that leaves me with telling you to wrap the call to
embedRelations in an if block:

        if ($this->isNew()) {
                $this->embedRelations(...);
        }

in your main object form's configure method!

I know how to turn this bug into a really great feature so you can add
a new related object while creating the main object (as outlined by
Jonathan Wage here: 
http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin)
but unfortunately, I don't have time right now. :(

Please accept my sincere apologies for this gaping hole in the
plugin's functionality and my own stupidity on this!

A little explanation on why this didn't show up in my app: I have
separate forms for creating a new main object. These forms are
themselves using the new useFields() method and so the embedded
relations are immediately unset again after running the configure()
method of the parent form.

Note that there's no error generated when the user does not add a new
related object as it's then discarded silently.

See the attached screenshot for the problem that's described here.

I am so sorry for this mess!


Kind regards,
Daniel

@Mikael: I hope you don't mind me including the snippet of your email
below as it didn't contain any personal information.

>On 20.02.2010, at 18:33, Mikael Kermorgant wrote:
>
>Hi,
>
>no pb, you're welcome.
>
>While we're talking about this, here's a feature request :
>
>Add a related object from the same form. The hard thing would be to grab the 
>generated id from the main object created.
>
>[edited]
>
>Regards, Mikael

-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" 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.com/group/symfony-users?hl=en.

Reply via email to