Avoid "The unpublish on date must be later than the publish on date" when publishing is not enabled.

Created on 2 November 2020, over 3 years ago
Updated 26 October 2023, 8 months ago

Problem/Motivation

User can't edit publish_on date on validation error if content type used to be having that enabled before.

Validation error:

The 'unpublish on' date must be later than the 'publish on' date.

In DB I saw that when disabling publish_on for content type, the publish_on dates were not cleared.

Steps to reproduce

  1. Install Drupal standard and scheduler
  2. Enable publish_on for article content type
  3. Create content having publish_on date on future
  4. Disable publish_on from article content type
  5. Enable unpublish_on to article content type
  6. Edit previously made content with unpublish_on date that is before previously defined publish_on date

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇫🇮Finland iMiksu Finland

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.

  • I just stumbled upon this as well. As a quick fix have completely removed the check whether the unpublish field is in the past, because I don't see the point of it.
    Without the check everything works fine. Also if the date is in the past and the node is published it will be unpublished by the cronjob like it should.

    So in my opinion this check should be completely removed, or made optional just like with the publish date field.

  • 🇬🇧United Kingdom jonathan1055

    Hi Paul Dudink

    completely removed the check whether the unpublish field is in the past,

    I think you may have mis-read the details of this issue. The problem is not the validation with unpublish date , it is about the unpublish date not being earlier than the publish date.

    You may have a valid reason for wanting that check removed, but it is not what this issue is about. There is an issue #3122973: Allow unpublish_on dates in the past which might be relevent and you are welcome to post there instead.

Production build 0.69.0 2024