When a moderation state is removed from a workflow, existing revisions keep that state stored on them. Diff shows the moderation state next to each revision on the revision overview, and it looks that state up without checking whether it still exists. One such revision is enough to bring down the entire page:
InvalidArgumentException: The state 'ready_for_publication' does not exist in workflow.
in Drupal\workflows\Plugin\WorkflowTypeBase->getState()
The result is a white screen on /node/{nid}/revisions. All revisions of that node become unreachable through the UI, not only the one in the removed state.
Steps to reproduce
1. Install content_moderation and diff.
2. Enable the editorial workflow on a content type.
3. Create a node, publish it, archive it, then publish it again. The Archived state is now only used by an older revision.
4. Delete the Archived state at /admin/config/workflow/workflows/manage/editorial. Core allows this, because no current content uses it.
5. Visit /node/{nid}/revisions.
Expected: the revision overview loads.
Actual: white screen, with the exception above.
| Comment | File | Size | Author |
|---|
Issue fork diff-3617616
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
Comment #2
esthertempel commentedA patch that worked for our Drupal 11 site is attached
Comment #3
acbramley commentedThanks for the report and contribution, however patches are no longer accepted. Work will need to be done in an MR for review. We will also want some tests.
Comment #5
acbramley commentedComment #6
acbramley commentedFixed, the test can't be enabled without the core fix.