1

From the admin, if I delete a user they disappear from the admin list but not from the users database table.

Looking through the code I can see UsersService.php has a function deleteUser which calls the deleteElementById from ElementsService.php - but it does not seem to actually remove the user from the main users table at all.

The version of craft in use has recently been updated to 2.9.2 following the Craft CMS guide and I've read there maybe Foreign Key issues in the database, but the fixes (plugins) seem to only be for Craft 3, and we are unable to upgrade at this time.

Also looked at > Users not being deleted from the craft_users table?

But as this did not have a full answer and is not a fix for the CMS side of things it's not viable.

How can I determine 1) where the issue is, and 2) how to resolve it?

1 Answer 1

1

It definitely does sound like a missing foreign key constraint issue.

The Craft 2 version of the Fix FKs plugin for Craft 3 still lives here: https://github.com/pixelandtonic/craft-fixfks

I'd give that a whirl.

2
  • Thanks! I'll give it a bash.
    – Aravona
    Commented Aug 13, 2020 at 10:56
  • Unfortunately I can't seem to get the above to work, there is not a json file for 2.9.2, and I get a 404 or craft exception error when trying to run (local machine) - any ideas? Possibly I've the files in the wrong place?
    – Aravona
    Commented Aug 13, 2020 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.