-
-
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
No draft was identified by the request error on Approve and publish if the Entry is set Disabled by default #180
Comments
No draft was identified by the request
error on Approve and publishNo draft was identified by the request
error on Approve and publish
No draft was identified by the request
error on Approve and publishNo draft was identified by the request
error on Approve and publish
No draft was identified by the request
error on Approve and publish
No draft was identified by the request
error on Approve and publish
if the Entry is Disabled by default
No draft was identified by the request
error on Approve and publish
if the Entry is Disabled by defaultNo draft was identified by the request
error on Approve and publish
if the Entry is Disabled
by default
No draft was identified by the request
error on Approve and publish
if the Entry is Disabled
by default
Right, so this is one of those tricky edge cases where you're not working with a draft, like Workflow assumes, and how Craft otherwise works. The reason that as soon as you interact with the entry, is that a draft is created when you do that, and once a draft exist, and you hit "Approve", it applies that draft. Otherwise, when creating an entry from the front-end a draft isn't created so we hit this issue. I've added some handling here for the next release. To get the fix early, change your
Then run |
Thank you. I have updated to |
Hmm, can't seem to replicate that I'm afraid, after creating new submissions from the front-end. The changes should switch from using Are you able to check your Network requests to see if the action is being passed to |
Thank you, it's now submitting to However, I'm still facing the following challenges:
|
Sorry, I was a bit optimistic and am still getting
|
That's strange about the revision. Are you sure you're creating a brand new entry from the front end? On my end, there's no such revision information (also testing on a multi-site)
As for it not doing anything, I'm not surprised with it being a revision - it's probably targeting the wrong entry. Is there a As for the Are you able to send through the full stack trace of the error? Is it still the same error complaining about no draft existing? |
Yes, as you can see with this setup (no
But please note that in this multi-site config, Entries in this Channel are not enabled by default (
When clicking on the link in the notification email (
The Craft's entry form is available, but is in
I'm looking for a way to not have to do this manually. As in my case, every approved Entry should be published on every site (Entries in this Channel are not translated, and are the same on every site version). Also, if I enable the new Entry using the
I have sent it to you by email. This full stack trace is the one gotten from my previous scenario. |
Thanks for all the info. I'm still pretty dumfounded by how it's setting the revision, as that's one thing I can't replicate. There shouldn't even be a revision for a brand new entry where you haven't touched anything, which is what I don't understand.
I thought that might be the differentiating factor, but I've tested that as well. I'll keep at it.
I'll see what I can do, but we just need to be careful about setting the status across all sites automatically. As for the actual issue of the latest 400 error (please let me know if this is also correct):
I can see why this happens. This is because as soon as you touch anything on the entry, it'll create a provisional draft. However, Workflow won't know about that and think you're still trying to modify an existing entry, not a draft. I'm going to have to revisit creating submissions from the front end. It used to be the case where you could create a draft from the front-end, but that's no longer possible in Craft 4. It's pretty critical that front-end-created entries are created as unpublished drafts, just like the control panel for consistency. I'll let you know how things go. |
Okay, so I've created a custom endpoint to create and save a draft submission for, used for the front-end. {{ actionInput('workflow/elements/save-entry') }} You should only need to change the |
FYI the multi-site is set up with this propagation method:
Regarding the
This is the stack trace:
|
Sorry, looking at the error message, it looks like you are. Because I'm struggling to replicate this one, maybe you could add some debugging to Craft's |
Yes I am.
Sorry, I'm not sure of what I should do. I should edit the Craft source code in my |
Ah, managed to figure out a scenario that wouldn't work, if you can try again after a |
I have run a Please can you confirm that your edits are the one I can see here? If yes, I'm sorry: I'm still getting the error. FYI I'm still using |
Yep, those were the edits in that commit. Any chance you'd be able to send over your site project files, including the database? Understand if you can't share, but if you can send to |
Of course, thank you, it's in your inbox 📧 |
Thanks @romainpoirier so running with your setup, I'm having no issue adding things. Here's the exact form I'm using:
Having created the draft entry: Is there something I'm maybe missing about your setup? |
Thank you for your tests. I can make it works without getting the But I still get an error in my context, where I'm submitting the form thought AJAX:
Is there something else to adapt ( Also, with your test, the downside is that I don't get the email notification as soon as the Entry is submitted from front-end. I receive it just after the submitted Entry is reviewed and published from the CP: i.e., until the This is not the behavior I'm looking for: how can I trigger this sending of the notification on front-end submit (with a not enabled Entry)? |
Ah, that makes sense! Those issues should be sorted in the latest |
Now it works, perfect, thank you! Do you have any update for the ability to enable for all sites when clicking on Approve and publish? |
Fixed in 2.0.4. Still testing out the "Approve and publish" behaviour - best to open up a new issue. |
Describe the bug
I have a Channel where the
Default Status
is set toDisabled
.I have a front-end form setup following the explanations in the doc:
The newly submitted Entries are appearing disabled in the Channel. When reviewing them, and clicking on the
Approve and publish
button to approve them and set them live, I get this error:The Entry doesn't appear as draft in the CP, but as a
Disabled
Entry. I'm getting an unexpected error about draft, while theentries/save-entry
was triggered andenabled
set tofalse
.However, if I enable the new Entry using the
Enabled for all sites
Lightswitch just before clicking theApprove and publish
button, I don't get this error.Is there any way to prevent the error, and make the
Approve and publish
button setting the Entry asEnabled
simultaneously?Steps to reproduce
Approve and publish
buttonCraft CMS version
4.3.5
Plugin version
2.0.3
Multi-site?
Yes
Additional context
No response
The text was updated successfully, but these errors were encountered: