Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a user destroys their entries instead of assigning them to selected user #5838

Closed
LarsDol opened this issue Mar 25, 2020 · 4 comments
Closed

Comments

@LarsDol
Copy link

@LarsDol LarsDol commented Mar 25, 2020

Description

We're in the middle of updating a (large) website of one of our clients from Craft 2 to 3. While testing, our client tried to delete one of the user accounts. She selected another account as the assignee for the deleted user's entries.

We expected the entries to be assigned to this other user, but instead they disappeared altogether. As if the Delete it option was selected.

I've reproduced this multiple times, and it seems to happen when the users involved are assigned to a specific user group which are not admins. In some other cases it worked normally though. I couldn't really pinpoint when or what causes this exact behaviour, but it can potentially lead to them destroying a lot of valuable content by accident - So I think it's worth checking out.

No custom code regarding CMS users was added to this project, so I suspect it's something in Craft itself — but I may be wrong about that.

Steps to reproduce

  1. Create multiple users in the CMS
  2. Create user roles that are able to manage a subset of entries (specific sections)
  3. Assign the same role(s) to two of the users. These shouldn't be admin roles.
  4. Create some content using user 1
  5. Go to the users overview, select user 1 and click delete
  6. Select user 2 in the Transfer it to: modal
  7. In our case, all content created at step 4 is deleted instead of transferred to user 2

Additional info

  • Craft version: 3.4.10.1
  • PHP version: 7.2.10
  • Database driver & version: mysql 5.0.12
  • (Notable) Plugins & versions:
    -- SEO 3.6.3
    -- SEOmatic 3.2.48
    -- Redactor 2.6.1
    -- Neo 2.6.3
    -- Maps 3.8.2
    -- Freeform 3.6.5
    -- Asset Rev 6.0.2

There's some more plugins installed, but I don't think they can possibly affect this issue.

Thanks in advance for checking this out!
Lars

@LarsDol

This comment has been minimized.

Copy link
Author

@LarsDol LarsDol commented Mar 25, 2020

I've ran some more tests, and it seems like this is only happening when triggering the delete action from the user overview screen. When navigating to a users detail (edit/profile )page first, and starting the deletion from there all seems to be working correct.

EDIT: our client tells me they started the deletion from the user's detail page. So this doesn't seem very consistent.

@brandonkelly

This comment has been minimized.

Copy link
Member

@brandonkelly brandonkelly commented Mar 26, 2020

Sorry about this. I was able to reproduce when deleting a user from the Users index page, however the Edit User page is working as expected for me.

Worth noting that the user and their content would have only been soft-deleted, so you should be able to restore the deleted user and their entries, by selecting the “Trashed” status on the Users and Entries index pages.

@LarsDol

This comment has been minimized.

Copy link
Author

@LarsDol LarsDol commented Mar 26, 2020

Awesome, thanks for the fast response!

@brandonkelly

This comment has been minimized.

Copy link
Member

@brandonkelly brandonkelly commented Mar 26, 2020

Craft 3.4.11 is out now with the fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.