-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Manually applying a draft or creating an entry from a draft leaves the submission in pending state #187
Comments
Hmmm, it's a big assumption to make that if a draft that was linked to the submission that now doesn't exist means that it's been approved. But I suppose short of a draft being outright deleted, there's not too many other scenarios that could happen. I'll give it some further thought. |
@engram-design Can't this be done with entry save hooks? When an entry is saved, the plugin can hook into the save process and check if the draft being saved is associated with any pending submission and approve that submission. This leaves out any guesswork. Or am I missing something? |
All of workflows actions are already on the save events, but only if they “opt in” to a workflow action. In theory what you propose should be okay, but I feel like I might be missing something (I can’t think of immediately) so I’ll test out a few scenarios. |
@engram-design Got it, thanks! |
Hi all, Is there maybe an update on this? |
Describe the bug
When a publisher reviews a submission, they get the options to approve or reject the submission. Approving it will automatically apply the draft, or create an entry if it's an unpublished draft for a new entry. However, the publishers also have the regular buttons to apply the draft (or
Create entry
for unpublished drafts). Using those will leave the submission inPending
state. In this case, the interface for approving or rejecting the submission is still displayed:However, trying to approve or reject the submission will result in an error:
This makes sense, since the draft the submission was referencing doesn't exist any more. But from a user's perspective, this is an error and is hard to understand.
I think the best solution would be to automatically set the submission to
Approved
in this case. If the draft is manually applied, this means the submission was accepted, so this makes sense from the publisher's perspective. This would also mean that the email notification to the editor is sent as well, which is currently impossible, since the submission can't be approved once the draft has been applied.Steps to reproduce
Create entry
.Approve and publish
, this will cause the error mentioned above.Craft CMS version
4.4.5
Plugin version
2.0.4
Multi-site?
No
Additional context
No response
The text was updated successfully, but these errors were encountered: