EntityViewEvent::__construct(): Argument #4 ($viewMode) must be of type string, int given

Created on 9 September 2024, 3 months ago

Problem/Motivation

On an existing website, we want to start replacing our hooks with events. This website has multiple numerical view modes for the Media entity type (eg. 100 => '100%', 75 => '75%', ...). This wasn't an issue when using hooks, but after installing the module all pages displaying a Media entity using such a view mode crash.

Proposed resolution

Since it is possible to create view modes with a numerical ID, it only seems logical to allow view modes with numerical IDs as well when using events.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇧🇪Belgium michaelsoetaert

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024