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.
Hi. Thank you for great module with so many options included.
We need to keep unpublish_on date all time, to know when a node has been unpublished.
However the field is flushed every time when a node is unpubleshed by scheduler module.
Comment | File | Size | Author |
---|---|---|---|
#1 | scheduler_keep_unpublish_date-2442003-1.patch | 3.11 KB | AlexKirienko |
Comments
Comment #1
AlexKirienko CreditAttribution: AlexKirienko at WikiJob commentedPlease check attached patch.
What was changed:
- "Keep unpublish date after unpublishing" option was added in Unpublishing fieldset on content type edit form.
- _scheduler_unpublish() will select only published nodes from db.
- new option checking on unpublishing before removing unpublish_on
- validation for unpublish_on
New option enabled:
- unpublish_on will be kept after unpublishing process.
- no unpublish_on < REQUEST_TIME validation errors for unpublished nodes.
- validation errors if user try to publish node with unpublish_on < REQUEST_TIME
Comment #2
mrded CreditAttribution: mrded commentedComment #3
jonathan1055 CreditAttribution: jonathan1055 commentedThanks for the patch but I think it is unlikely that we'll change the fundamental way that Scheduler works in 7.x. Too many other things may be relying on the date being removed from the table and the node.
Have you considered storing the date in a custom field? It is very easy to do with Rules, reacting on when Scheduler unpublishes the node to populate your field. I have provided an example in #2492755: Save scheduling date after publishing
Comment #4
AlexKirienko CreditAttribution: AlexKirienko at WikiJob commentedHi, @jonathan1055.
Thank you for replay. We display unpublished date in views with statistic data. With custom field we will need to update all views. We also will need update all existing nodes to save date to new field.
This patch does not change functionality of module. It adds option to save publish date. By default this option disabled.
We use this patch on production site since February. It works great and not affect default functionality.
if you did not agree to add
It can be also add as option.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI am not sure if this is a bug or feature request but It has to do with this patch. I think.
https://www.drupal.org/node/2701923
I set the time for my content time to be unpublished.
The time passes.
I go back and edit it.
I get this error and cannot save: The 'unpublish on' date must be in the future
I should get a warning instead and be allowed to save the node.
Comment #6
jonathan1055 CreditAttribution: jonathan1055 commentedThe situation you describe in #5 is only marginally related to #2701923: Give warning not an error for unpublish date in the past.
And please, there is no need to post your same problem in two issues. We monitor this queue very ferquently, so it is unlikely we would miss the issue. So please do not make work by posting things twice :-)
Comment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHi AlexKirienko,
In reply to #4, I understand your scenario, but this is a fairly marginal case. No other users have wanted this, and as I said before it is a fundamental change to how Scheduler operates, which could well cause us more problems if we implemented this option. The list of scheduled content would also need to be changed. Other users' views would suddenly start showing more content, and that could break existing sites.
I am pleased that you are using your patch sucessfully in production. As I mentioned, you could also use something like the example with rules in #2492755-6: Save scheduling date after publishing. Yes, you would have to update your existing content, but that is only a one-off, and not too difficult. You could also use the Scheduler API functions to react when a node is unpublished.
I am closing this issue now, but I thank you for your comments and ideas for Scheduler, and please do not hesitate to open new issues, we are always happy to help.
Jonathan