Custom content entity with content moderation PHP Warning: array_flip(): Can only flip STRING and INTEGER values!

Created on 1 February 2023, over 1 year ago
Updated 3 February 2023, over 1 year ago

Problem/Motivation

First noticed on bibcite references, and confirmed on simple custom content entity.

Steps to reproduce

Enable content moderation module, and update workflow to include custom entity (allow bundles on it).
Create custom entity with draft state, save it. Then publish it. Once published, edit again and set draft as moderation state.
There will be PHP Warning: array_flip(): Can only flip STRING and INTEGER values!

Proposed resolution

Make sure latest revision id is not null before trying to load it. This means wrapping one line with if statement.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada igorbiki

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

Comments & Activities

Production build 0.69.0 2024