Log entity creation fetches entity label poorly

Created on 3 August 2022, almost 2 years ago
Updated 1 September 2023, 10 months ago

Problem/Motivation

Current implementation of entity label fetch is using array conversion from the entity expecting certain keywords to exist.

This is not the case with many of the entities. Especially with Webform entities, the array does not contain similar structure.

With PHP 8, this problem turns into fatal error;

 [error]  TypeError: Cannot access offset of type string on string in Drupal\events_logging\Logger->createLogEntity() (line 119 of /var/www/html/web/modules/contrib/events_logging/src/Logger.php)

I created example where this is easily visible between PHP 7 and PHP 8 which you can find in here

Proposed resolution

Use proper function to get entity label

🐛 Bug report
Status

Fixed

Version

1.5

Component

Code

Created by

🇫🇮Finland Dropa

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024