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 » plugins » User management plugins » [sfGuardDoctrine] Integrity Exception
[sfGuardDoctrine] Integrity Exception [message #55200] Mon, 30 June 2008 19:19 Go to next message
tobi11  is currently offline tobi11
Messages: 3
Registered: June 2008
Junior Member
Hi!
When I want to add or update an User or a Group with the automatic Admin Interface I get the following exception:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`sf_test/sf_guard_group_permission`, CONSTRAINT `sf_guard_group_permission_ibfk_1` FOREIGN KEY (`permission_id`) REFERENCES `sf_guard_permission` (`id`)
ON DELETE CASCADE)
or
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`sf_test/sf_guard_user_group`, CONSTRAINT `sf_guard_user_group_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `sf_guard_group` (`id`)
ON DELETE CASCADE)
Does somebody know how to fix this?
I am using symfony v.1.1.0 under php 5.2.3 with MySQL 5.0.41.
thanks

[Updated on: Mon, 30 June 2008 19:20]

Re: [sfGuardDoctrine] Integrity Exception [message #57846 is a reply to message #55200 ] Mon, 04 August 2008 20:11 Go to previous messageGo to next message
jukea  is currently offline jukea
Messages: 2
Registered: August 2008
Location: Montreal
Junior Member
same problem here ..

It seems it has to do with the fact when saving i.e a group, the sql insert query for the group<->permission table lacks the (required) permission_id
at Doctrine_Connection->insert(object('sfGuardUserGroupTable'), array('user_id' => '2', 'created_at' => '2008-08-04 14:01:14', 'updated_at' => '2008-08-04 14:01:14'))
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Connection/UnitOfWork.php line 575 ...

is sfGuardDoctrinePlugin actively developped ? can we expect it to be resolved shortly ?

thanks
Re: [sfGuardDoctrine] Integrity Exception [message #57852 is a reply to message #55200 ] Mon, 04 August 2008 22:05 Go to previous message
jukea  is currently offline jukea
Messages: 2
Registered: August 2008
Location: Montreal
Junior Member
I found a fix :

http://trac.symfony-project.org/ticket/3838

look at the first comment. It worked for me too.

hope this helps!
Previous Topic:sfGuard permission extra value
Next Topic:table/class prefix an sfGuard
Goto Forum:
  

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