The state '' does not exist in workflow.

Created on 4 April 2023, about 2 years ago

Problem/Motivation

I got issue with loading translation item, caused by wrong getting content_moderation state.

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

Steps to reproduce

Unfortunately, I can't tell steps to reproduce, because other translation items doesn't have any problem.

Proposed resolution

Attaching screenshot. Entity has content_moderation value ($TESTING).

Actually I don't understand why there is checked $item->getData(['#moderation_state'] instead of simply $entity->get('moderation_state')->value (loading speed improvements ??).
Changed condition if !empty. Checked that there is no warning appears if array key missing.

πŸ› Bug report
Status

Active

Version

1.0

Component

Core

Created by

πŸ‡ΊπŸ‡¦Ukraine Anna D

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

Comments & Activities

Production build 0.71.5 2024