-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
PublishLater may not display the intended date / time for a content item. Because the background task may run later than the intended publish date / time, the resulting publish will have a later than intended time. This is especially true if a user edits post around midnight, intending to publish for a specific date, but the publish doesn't run until after midnight. The Publish Later input uses the current time by default, so a user editing a content item around midnight might accidentally set a Publish Later to occur the day after it is intended. Then a content item intended to be published on 7/15 could display a published date of 7/16 for example. This can cause the publish date of content to become misaligned across communication channels and timezones.
While this is technically correct from a code perspective, there should be a way to choose the intended publish time versus the actual publish time as the PublishedUtc.
Before the following PR, it was possible to overwrite the PublishedUtc with the intended publish date, however the refactor moving the PublishLaterPart nullification from the PublishLaterPartHandler to the background task removed this capability.
Previously, it was possible to hook into PublishedAsync, with a handler ordered before the PublishLaterContentPartHandler, and overwrite the PublishedUtc with the ScheduledPublishUtc. I think this was a suitable workaround and that this was a more correct place to handle the content part removal, although I understand it probably caused a conflict with the background task.
I'm open to alternative solutions for this, but the current combination of behaviors can result in unexpected behavior when editing content.
Orchard Core version
2.1.6
To Reproduce
Schedule a publish for 11:59:59pm and see the published date reflect the following day.
Expected behavior
There should be a way to use 11:59:59pm as the publish datetime.
Logs and screenshots
N/A