-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
OrchardCore.Workflows Publish Content task does not publish content #16939
Comments
Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs. |
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
Can you try this change? if (!content.HasDraft())
{
return Outcomes("Noop");
} instead of if (string.Equals(InlineEvent.ContentItemId, content.ContentItem.ContentItemId, StringComparison.OrdinalIgnoreCase))
{
return Outcomes("Noop");
} Then test with an |
@AmyBlaine please test the related PR, I did a quick test, seems everything works as expected |
We tested this change during triage. The ask here was to test more thoroughly with events triggers inline or not. And bonus with functional tests that would catch any regression in these tasks. |
Ah, I didn't know that you are testing that during triage, @AmyBlaine please do some test through UI, I will try to add a functional test |
Here are the workflows I used to test. Recipe.json Publish Approval Process on Content Draft Saved event Test Publish Content with UpdateContentTask start event For the 'Publish content on a schedule' workflow, another change may be needed. For this test, I created a new content item, then set the contentItemId explicitly in the Publish Content task. The content item was not found here: OrchardCore/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs Line 118 in b60a530
I tried this change assuming that when a content item is created, it is the latest version of the content item by default. OrchardCore/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs Line 567 in b60a530
With this additional change, the 'Publish content on a schedule' workflow succeeds. |
@AmyBlaine you need to fork the repository and do the changes on your fork. |
Describe the bug
The workflow module 'publish content' task fails to publish content when triggered by an event.
Orchard Core version
2.0.2 - Simple web application with 2.0.2 nuget packages
1.8.3 - Simple web application with 1.8.3 nuget packages
701c07e - OrchardCore.Cms.Web
To Reproduce
Example #2
Expected behavior
The content item is published by the workflow when the Publish Content task is triggered.
The workflow does not need to be restarted for the publish content task to run successfully.
Observations
The content item is published when InlineEvent.ContentItemId is null which occurs when the workflow is restarted.
OrchardCore/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/PublishContentTask.cs
Line 35 in 08de169
Logs and screenshots
Simplified Workflow
Example #2 Workflow
Logs
orchard-log-2024-10-30.log
Why is this important?
My goal is to configure a publishing approval process using workflows. Ultimately, a user with the author role will create a draft content item, then a user with an editor role will approve the content item prior to it being published.
The following workflow fails to publish a content item. While troubleshooting, I reproduced the same problem without inserting the User Task event as this propagates the number of workflow instances with each 'Approve and Save' action.
The text was updated successfully, but these errors were encountered: