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.
Issue fork content_reviewed_date-3636478
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:
- 3636478-passed-next-review-date
changes, plain diff MR !2
Comments
Comment #3
svendecabooterComment #5
ajetiv1