-
-
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? |
@engram-design Did you have a chance to test out the edge-case you were worried about yet? The client just ran into this issue again. It's really tough to communicate that they can't use the regular buttons to save entries at all while a submission is pending, or the submission will be in an unclear state. It would be great if this could be addressed in some way. If automatically approving the submission as mentioned above is not an option: Maybe the submission card in the sidebar (as well as the submission page) could identify if this case occurred (pending submission with a draft that no longer exists), and offer a way to revover? I'm imagining an alert / prompt like this:
|
Just a few little things to fix up, due to draft behaviour being different for new vs existing entries. To get this early, run |
@engram-design Thanks! We're already on Craft 5 with this project (at least in dev, I'm finalizing the update atm), I'm not seeing the same change in the |
I usually merge things for each major version at the time of release, but happy to merge now. To get this early, run |
@engram-design Thanks, I'll give it a try 👍 |
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: