Friday, February 18, 2011

Unknown record property / related component "profile" on "sfGuardUser"

If you got this error:

500 | Internal Server Error | Doctrine_Record_UnknownPropertyException Unknown record property / related component "user" on "sfGuardUserProfile"

You are lucky, this error bothered me for a long time, but now you know the answer!

user_id in Profile must be interger(4)

the important part is (4)

if you don't have it in the schema, you will get the error above.

example:

sfGuardUserProfile:   columns:     user_id: {type: integer(4)}     email: {type: string(100), email: true}     favorite_color: {type: string(100)}   indexes:     user_id_fk_idx:       fields: [user_id]   relations:     User:       class: sfGuardUser       local: user_id       foreign: id       type: one       foreignType: one       foreignAlias: Profile


keywords:

symfony 1.4 sfGuardUser Profile sfDoctrineGuardPlugin


--
Kindest Regards,

Zhen Sun