Generated with the help of an LLM.

Problem/Motivation

"Mark as reviewed" (the form, the bulk action on the dashboard and the MarkReviewedAction) always passes a next review date to ReviewedDateManager::markAsReviewed(): the date chosen in the form, which defaults to today + the review period. That date is stored as an explicit next review date, even when the editor didn't change it.

From then on the stored date wins over the review period:

  • A later edit records a review, but keeps the stored next date. So a page edited 11 months after it was marked is due again a month later, instead of a year after the edit.
  • When an administrator changes the review period of a content type, nodes that were marked keep their old due date.

That doesn't seem to be the intention, as the field description says "Optional. A specific date for the next review, instead of the usual @days days."

Steps to reproduce

  • Track a content type with a review period of 365 days.
  • Mark a node as reviewed without changing "Review again on".
  • Check content_review_next_date on the node: it holds today + 365 days.
  • Change the review period to 180 days. The node is still due in 365 days.

Proposed resolution

In markAsReviewed(), treat a next review date equal to the review date + the review period as "no specific date": store none, so the period applies. Only a date that differs from that is stored.

Remaining tasks

  • Review.
  • Test coverage.

User interface changes

None.

API changes

markAsReviewed() clears the stored next review date when the given one equals the period default.

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
svendecabooter’s picture

Created a MR. markAsReviewed() now stores no next review date when the given one equals the review date + the period, so it fixes the form, the bulk action and the action plugin in one place.

Added a unit test for that case. testDashboardAndPermissions asserted the old behaviour after bulk marking (an explicit date of today + 365 days), so it now checks that no date is stored and the node is not stale.

phpcs, phpstan (level max) and the full test suite pass locally on Drupal 11.4.

  • ajetiv1 committed 439ed13b on 1.2.x
    Issue #3636482 by svendecabooter, ajetiv1: Mark as reviewed always...
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.