Generated with the help of an LLM.

Problem/Motivation

Once the next review date of a node is in the past, the node edit form can no longer be saved. The "Review again on" field in the "Content review" box is pre-filled with the stored next review date, and validateNodeForm() refuses any date that is not in the future. So every save fails with "The next review date must be in the future.", until the editor clears that field.

This happens to every node that was marked as reviewed, because "Mark as reviewed" always stores a next review date (today + the review period). A year later that date has passed, the node shows up as overdue, and the editor who opens it to update it can't save.

It also applies to the Layout Builder form, as that uses the same base form ID.

Steps to reproduce

  • Track a content type, with the default settings.
  • Mark a node as reviewed.
  • Set its next review date in the past, to simulate time passing, for example with $node->set('content_review_next_date', '2026-01-01')->save();.
  • Edit the node and save it. The form fails validation on "Review again on".

Proposed resolution

Only pre-fill the field with a date that is still in the future. A passed date is no longer something the editor can keep, and leaving the field empty lets the save record a review with the normal period.

An alternative would be to only validate the field when its value changed. But keeping a passed date in the form doesn't seem useful to me.

Remaining tasks

  • Review.
  • Maybe a test with a passed next review date.

User interface changes

None, except that the field is empty instead of showing a passed date.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

svendecabooter created an issue. See original summary.

svendecabooter’s picture

Status: Active » Needs review

  • ajetiv1 committed 263dfc6a on 1.2.x
    Issue #3636478 by svendecabooter: Node form can't be saved once a...
ajetiv1’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.