Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the 'Past Date' option set to 'Publish Immediately' the node is correctly published when entering a date in the past. However, the publish_on date is not removed, but is set to 1970-01-01 i.e. timestamp value zero. This is how it used to be done in 7.x but in 8.x the date value should be set to NULL.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2666832-4.past-date-set-publish-on-to-null-not-zero.patch | 1.45 KB | jonathan1055 |
#3 | past date set to zero.png | 50.76 KB | jonathan1055 |
Comments
Comment #3
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedAttached is what you get in the Scheduled tab.
I have added an extra assertion in SchedulerPastDatesTests to check that the value is NULL, to make sure we fix it and do not regress. This class was passing but now it has one failure.
Should be a trivial fix to make, though.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedIn addition to the zero in scheduler_node_presave() there are also two places in .rules.inc which remove the dates. Even though the whole Rules functionality has not been converted yet #2651348: Port Rules integration for Scheduler to Drupal 8 this change might as well be done here in one place.
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedGood. As expected the SchedulerPastDates is now green with a full set of passes.
Manual testing is also OK, the date is removed.
Setting back to 'needs review' for other folk to verify the change.
Comment #7
pfrenssenLooking good, thanks!
Comment #9
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks for the review. Fixed.
... and an extra class passes. Now 23 passes and 5 fails.