Sector workflows breaks if no content types are assigned to a workflow

Created on 26 October 2023, about 1 year ago
Updated 7 November 2023, about 1 year ago

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.

🐛 Bug report
Status

Fixed

Version

10.0

Component

Code

Created by

🇳🇿New Zealand dieuwe Auckland, NZ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024