Deleting moderation state which still have revisions save in that state creates error when trying to display those reivsion

Created on 21 February 2022, over 2 years ago
Updated 30 July 2023, about 1 year ago

Problem/Motivation

When deleting a moderation state there can still be revision that have been saved in that moderation state. If there are revision saved in that moderation state, and the moderation state is deleted, you will get an error when vising the revision log for that entity like this:

InvalidArgumentException: The state 'need_review' does not exist in workflow. in Drupal\workflows\Plugin\WorkflowTypeBase->getState() (line 155 of /code/web/core/modules/workflows/src/Plugin/WorkflowTypeBase.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Content moderationΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡¦πŸ‡ΊAustralia @Sam152
Created by

πŸ‡³πŸ‡΄Norway matsbla

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Based on #9 and #10 seems like it could still be a problem

  • πŸ‡ΊπŸ‡ΈUnited States wweibel

    Issue is still present in 10.1.2

    An approach would be to default to the 'Default State' of the workflow in these instances. Or when deleting a state require the new state be selected and update all the revisions.

    I would prefer the later to avoid stale data being present. Removing the ability to delete states (if there are revisions in that state) is rather heavy handed and virtually guarantees that no state could ever be deleted, and would not reflect changes to human workflow.

Production build 0.71.5 2024