Problem/Motivation

The sector workflow code contains a number of checks on the "moderation_state" field from nodes loaded against the current route. It's simply assumed this field exists, but it only does if at least 1 content type is assigned to 1 workflows.

Steps to reproduce

Remove all content types from all workflows and then visit a node. You will get an internal server error.

Proposed resolution

Improve the checks throughout the sector workflow code with hasField('moderation_state') before we attempt to access it.

Remaining tasks

1. Provide patch.

2. Create a follow up task to continue to refactor this? The workflows checks are fairly bloated and could be simplified with better helper class work and could also be generalised more to apply to all types of entities and not just nodes.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork sector-3397043

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

dieuwe created an issue. See original summary.

  • dieuwe committed 61d3cb3a on 10.0.x
    Issue #3397043 - Improve checks before accessing moderation_state field
    
dieuwe’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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