Deleting user gives foreign key error

Asked by keifer

I'm on 1.6.1

I can create new Users fine, but when i try to delete a User i get:

"Unable to delete User Group"

I don't have any user groups setup!

Here's what i get in the error log:

11886 2014-07-28 18:36:55 user

<errormsg>Unable to delete User Group.</errormsg>
<errornum>256</errornum>
<errortype>User Error</errortype>
<scriptname>/var/www/xibo/lib/pages/user.class.php</scriptname>
<scriptlinenum>430</scriptlinenum>

11885 2014-07-28 18:36:55 user

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`xibo`.`lkusergroup`, CONSTRAINT `lkusergroup_ibfk_1` FOREIGN KEY (`GroupID`) REFERENCES `group` (`groupID`))

11884 2014-07-28 18:36:55 user

<errormsg>Undefined variable: userID</errormsg>
<errornum>8</errornum>
<errortype>Notice</errortype>
<scriptname>/var/www/xibo/lib/data/usergroup.data.class.php</scriptname>
<scriptlinenum>259</scriptlinenum>

Can someone please help as to why this happens and how can i resolve it?

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
keifer (keifer2006) said :
#1

Bump

Anyone ever encounter this problem?

Revision history for this message
Alex Harrington (alexharrington) said :
#2

Pretty sure this is fixed in 1.6.2

Revision history for this message
keifer (keifer2006) said :
#3

Hi Alex

The problem persists.

I just upgraded to 1.6.2 and created a new user.

I then tried to delete it and get the exact same error: "Unable to delete User Group".

From the log:

3 2014-08-06 17:39:44 user
<errormsg>Unable to delete User Group.</errormsg>
<errornum>256</errornum>
<errortype>User Error</errortype>
<scriptname>/var/www/xibo/lib/pages/user.class.php</scriptname>
<scriptlinenum>430</scriptlinenum>

2 2014-08-06 17:39:44 user
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`xibo`.`lkusergroup`, CONSTRAINT `lkusergroup_ibfk_1` FOREIGN KEY (`GroupID`) REFERENCES `group` (`groupID`))

1 2014-08-06 17:39:44 user
<errormsg>Undefined variable: userID</errormsg>
<errornum>8</errornum>
<errortype>Notice</errortype>
<scriptname>/var/www/xibo/lib/data/usergroup.data.class.php</scriptname>
<scriptlinenum>259</scriptlinenum>

Any suggestions? Please help...

Revision history for this message
Alex Harrington (alexharrington) said :
#4

Can you delete a user you create now? The old user may be problematic but a
new user should be able to be deleted

Revision history for this message
keifer (keifer2006) said :
#5

Hi Alex

Yep so I tried creating a new user again and tried deleting it immediately and get the same error. It affects all accounts (new or existing).

Are you not able to replicate this issue on your end?

Let me know, thanks!

Revision history for this message
Dan Garner (dangarner) said :
#6

Please see the attached bug for a patch to fix the issue.

Can you help with this problem?

Provide an answer of your own, or ask keifer for more information if necessary.

To post a message you must log in.