I had the same problem here.

Jon told me to do

$object->related_id = null;
$object->save();
and now it seems to work

good luck

On May 21, 5:32 am, wissl <andreas.wi...@googlemail.com> wrote:
> Not sure if you registered it before, so I ask you to get a
> confirmation: Did you try to add "notnull: false" to your schema
> definition?
>
>  buyer_id:           { type: integer(4), notnull: false }
>
> We do similar things to that and it works without any problems...
>
> On May 19, 10:00 pm, Tom Haskins-Vaughan <t...@templestreetmedia.com>
> wrote:
>
> > symfony 1.2
>
> > Hi,
>
> > I have the following shopping cart class:
>
> > Cart:
> >    actAs: [Timestampable]
> >    columns:
> >      buyer_id:           { type: integer(4) }
> >      is_default:         { type: boolean, default: false }
> >    relations:
> >      Buyer:
> >        class: sfGuardUser
> >        local: buyer_id
> >        foreign: id
>
> > Now, when someone visits the site, and before logging in, I need to
> > creat a new Cart with no buyer id. But When I try to do this I get:
>
> > 500 | Internal Server Error | Doctrine_Validator_Exception
> > Validation failed in class sfGuardUser
>
> > 1 field had validation error:
>
> > * 1 validator failed on username (notnull)
>
> > So, I assume Doctrine is trying to create a new sfGuardUser to add to
> > the cart. But I want the buyer_id to be null until s/he logs in.
>
> > Any ideas?
>
> > Thanks.
>
> > Tom
--~--~---------~--~----~------------~-------~--~----~
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