Unpublish only published content

Created on 7 August 2023, over 1 year ago
Updated 6 June 2024, 9 months ago

Problem/Motivation

Scheduler doesn't check if a node is published or not before trying to unpublish it. While working with large sets of imported data the module tries to unpublish yet unpublished content, and changing the updated date to the moment the unpublish attempt was done.

Steps to reproduce

Proposed resolution

Add a status condidion check on the query for unpublish content.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇸Spain alvarodemendoza

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

Comments & Activities

  • Issue created by @alvarodemendoza
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    223 pass
  • 🇬🇧United Kingdom jonathan1055

    Hi AlvaroDeMendoza,
    Thanks for raising this. You probably have a good point, but also it suggests that we need to look at your imported data. If there is a Scheduler unpublish_on but the content is not published, then how did the date get set? Is there also a publish_on date on the nodes that have this problem?

    It does sound reasonable that Scheduler should check if the entity is published before adding it into the list to be unpublished. But I recall that there was some background reason to why this is not done. Maybe it was so that we process entities and then the unpublish_on date gets removed.

  • 🇪🇸Spain oskar_calvo

    Hello, I have the same problem.
    I'm working on a project with a lot of content that comes from feeds and is integrated with the scheduler.
    The problem with this bug is that it generates a lot of rows in the revisions tables.

    Maybe add a checkbox on admin/structure/types/manage/$node_type to let users choose if they want to add the Status filter to the query.

Production build 0.71.5 2024