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

Approved submissions appear as pending when approver user is deleted #219

Open
Aku-benj opened this issue Oct 29, 2024 · 2 comments
Open

Comments

@Aku-benj
Copy link

Aku-benj commented Oct 29, 2024

Describe the bug

When a user who has approved a worflow submission is deleted from the system, even if the transfert data to another user is used, the worflow approved actions are deleted. This put all old approved submission by this user in pending state but the entries are still published.

When the approver user is in the trash it looks like :
image
And then once cleaned the approved action is simply deleted:
image

tested with multiple entries and submission, that's why the date dont match in screenshots.

What's your proposed solution?

Find a way to reassign the workflow_reviews (actions) to the selected user if choosed during the user deletion process.
Or simple put NULL in the userId column of table workflow_reviews, seems to work without errors.

Steps to reproduce

  1. Create 3 users, first for the creation of submission and second one for the approbation, and one admin
  2. Create a submission with user one
  3. Approve it with second user
  4. Delete the approver user
  5. Empty trash of deleted users
  6. Check the previously approved submission

Craft CMS version

4.12.7

Plugin version

2.0.12

Multi-site?

Yes

Additional context

This is happening in all environments

@Aku-benj Aku-benj changed the title Approved entries appear as pending when approver user is deleted Approved submissions appear as pending when approver user is deleted Oct 29, 2024
@engram-design
Copy link
Member

Yep, probably an oversight on my part that was CASCADE reviews when the owner user is deleted.

Fixed for the next release. To get this early, run composer require verbb/workflow:"dev-craft-4 as 2.0.12".

I'll also investigate hooking into the user content transfer process to properly handle this as you'd expect when deleting a user.

@Aku-benj
Copy link
Author

Thanks a lot for the fast reply and the proposed fix. I will only have time to test it next week.

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

No branches or pull requests

2 participants