Not unpublishing nodes on Drupal 9

Created on 22 December 2021, almost 3 years ago
Updated 1 February 2024, 10 months ago

Problem/Motivation

The expiry finds nodes to expire, but because of Drupal 9, $node->setPublished(false); is no longer valid, and the node doesn't get unpublished.

Steps to reproduce

  • Create a node that should be expired
  • run cron
  • Expiry email is sent
  • Node is still published

Proposed resolution

use $node->setUnpublished();

Remaining tasks

Code it.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada sagesolutions

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