Closed ArcLP closed 8 years ago
Does XenForo actually remove rows from the xf_user
table when you delete a user?
It should. I don't know if it does currently. I'm no expert with mysql databases.
All I tried to do was deny a guy who got stopped by the moderated user thing.
the admincp said to either ignore, accept, or deny said user trying to register.
It's unfortunate XenForo works in this way though, we'll lose a data integrity guarantee if I remove the FKC, which would be a shame - it might be inevitable though. Failing that, perhaps I can remove the association record first when you try and delete a user, which would also solve the problem.
I'll look into it tonight.
Xenforo is a douche sometimes. (I'm joking Xenforo don't read this kill me pls)
Thank you for looking into it, I apologize for this hassle. Just wanted to let you know/help you out. Thank you very much for reading this.
Also this might be useless but here is more information on it if you need;
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Cannot delete or update a parent row: a foreign key constraint fails (database name
.xf_association_mc
, CONSTRAINT xf_association_mc_ibfk_1
FOREIGN KEY (xenforo_id
) REFERENCES xf_user
(user_id
)) - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Arc, 56 minutes ago
Stack Trace
Thanks for that. Just to update on this issue, it might have to be the weekend before I can look properly at it.
In the meantime if you need a workaround, you can manually disassociate the user from the ACP and then try to "re-deny" them.
Hey, any update? Found out I can't merge users. :P
Server Error
Mysqli statement execute error : Cannot delete or update a parent row: a foreign key constraint fails (databasename
.xf_association_mc
, CONSTRAINT xf_association_mc_ibfk_1
FOREIGN KEY (xenforo_id
) REFERENCES xf_user
(user_id
))
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297 Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479 Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 661 Zend_Db_Adapter_Abstract->delete() in XenForo/DataWriter.php at line 1839 XenForo_DataWriter->_delete() in XenForo/DataWriter.php at line 1792 XenForo_DataWriter->delete() in XenForo/Model/User.php at line 3082 XenForo_Model_User->mergeUsers() in XenForo/ControllerAdmin/User.php at line 645 XenForo_ControllerAdmin_User->actionMerge() in XenForo/FrontController.php at line 351 XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134 XenForo_FrontController->run() in /var/www/html/admin.php at line 13
@ArcLP Sorry for the delay, work has a way of sucking away free time! Thanks for the reminder.
I've looked into this and it would seem that XenForo do not use foreign keys anywhere in their codebase. Yay for data integrity!
I'm going to add an override for the _preDelete
function on the XenForo_DataWriter_User
class to try and work around this. I'll update this issue when I'm done.
39cb4fb11a0cfc469c52b6ade9ebb824f36caf8c
@ArcLP Please try the version available at https://github.com/lol768/XenForo-MCASSOC/releases/tag/1.1 and report back. Thanks!
HEY. It worked! Thank you very much for fixing it. :) 👍 Do you want to close this or me?
Again, thank you deeply. you deserve a ton of reputation and credit <3
Glad it fixed it, I'm happy to close :)
Thanks for the detailed report.
@ArcLP Can you do me a favour? Which version of XF do you use? I'd like to update the list of compatible versions
1.5.5
Cheers
Mysqli statement execute error : Cannot delete or update a parent row: a foreign key constraint fails (
databasename
.xf_association_mc
, CONSTRAINTxf_association_mc_ibfk_1
FOREIGN KEY (xenforo_id
) REFERENCESxf_user
(user_id
))Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297 Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479 Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 661 Zend_Db_Adapter_Abstract->delete() in XenForo/DataWriter.php at line 1839 XenForo_DataWriter->_delete() in XenForo/DataWriter.php at line 1792 XenForo_DataWriter->delete() in XenForo/Model/UserConfirmation.php at line 200 XenForo_Model_UserConfirmation->processUserModeration() in XenForo/ControllerAdmin/User.php at line 947 XenForo_ControllerAdmin_User->actionModeratedUpdate() in XenForo/FrontController.php at line 351 XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134 XenForo_FrontController->run() in /var/www/html/admin.php at line 13
what do?