This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Admin generator problem
Admin generator problem [message #102590] Fri, 16 July 2010 13:52 Go to previous message
skrobek  is currently offline skrobek
Messages: 1
Registered: July 2010
Location: Poland
Junior Member
Hello,
I have a problem with admin generator.
I have Table Content:
content:
    _attributes: { phpName: Content }
    id: ~   
    content_type_id: { phpName: ContentTypeId, type: INTEGER, size: '11', required: true, foreignTable: content_type, foreignReference: id, onDelete: RESTRICT, onUpdate: RESTRICT }
    title: { phpName: Title, type: VARCHAR, size: '255', required: false }    
    author: { phpName: Author, type: INTEGER, size: '11', primaryKey: true, required: true, foreignTable: sf_guard_user, foreignReference: id, onDelete: RESTRICT }
   
column author

Where author is foregin key to user Id i sf_guard_user table.
In Form this this is a hiddeninput field. When i try to add a new content, i have error:
39	Error sfPropelLogger	SQLSTATE[HY000]: General error: 1452 Cannot add or update a child row: a foreign key constraint fails (`wspanialespa4/content`, CONSTRAINT `content_FK_3` FOREIGN KEY (`author`) REFERENCES `sf_guard_user` (`id`))
40	Error PropelException	Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1452 Cannot add or update a child row: a foreign key constraint fails (`wspanialespa4/content`, CONSTRAINT `content_FK_3` FOREIGN KEY (`author`) REFERENCES `sf_guard_user` (`id`))] 


Where i can set a value of current user id ?
In generator ? How ?
Or maybe somewhere else ?

P.S sorry for my eng.

Read Message
Read Message
Previous Topic:upgrading from 1.2 to 1.4
Next Topic:How to create a new form
Goto Forum:

  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software