Open mariojsnunes opened 1 year ago
I've created a PR with proposed changes
FYI which version you are using, we already updated the OC.PublishLater
module in 1.4
FYI which version you are using, we already updated the
OC.PublishLater
module in1.4
This issue happened with 1.4.0-preview-16817, what's the best way to check the code of this version? I've update to the latest 1.5.0-preview over the weekend, so I'm not sure if it's still occurring now, good catch.
If you can test it in the latest bit it will be great
Yes, the items, already marked to be "published later" before the upgrade, should be edited and be "published later" again to populate the index table.
We may need an Admin tool to update index tables, I think there is an opened issue around this.
Migration step?
Okay I will suggest something.
Describe the bug
PublishLaterPartIndex sometimes has null values on ContentItemId, Published and Latest.
This causes the scheduler to find no items and thus the content will not be published. https://github.com/OrchardCMS/OrchardCore/blob/411206031d8d3e7626ed2f80c50c9bbfce958c9d/src/OrchardCore.Modules/OrchardCore.PublishLater/Services/ScheduledPublishingBackgroundTask.cs#L30-L33
To Reproduce
This has happened in prod a few times, but I couldn't reproduce it locally yet :/
But I've checked that other indexes for the same DocumentId are not affected. I've noticed a difference, for this index we are using
part.ContentItem
instead ofcontentItem
directly. https://github.com/OrchardCMS/OrchardCore/blob/411206031d8d3e7626ed2f80c50c9bbfce958c9d/src/OrchardCore.Modules/OrchardCore.PublishLater/Indexes/PublishLaterPartIndexProvider.cs#L65-L77Maybe there is an issue with
var part = contentItem.As<PublishLaterPart>();
and changing to contentItem would solve the issue? Any idea why is this happening?