Ads with end date in the past are republished by cron (show_todate field does not exist in node_load)

Created on 19 March 2015, over 9 years ago
Updated 9 June 2023, over 1 year ago

When an ad with a start and end date is expired (unpublished) via cron, it as republished, even though the current date is greater than the end date, and the ad should therefore remain unpublished.

What happens is that node_save() which is triggered by cron (with the correct value set for $node->status = 0) invokes the node_presave() hook which runs simpleads_node_presave() - this checks for a form field $node->field_ad_date[$node->language][0]['show_todate'] which doesn't exist when a node is loaded via node_load. So because this value does not exist, the module presumes there is no end date and sets the status to published.

I am working on a fix.

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa foxtrotcharlie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024