TypeError: core_event_dispatcher_entity_create_access(): Argument #3 ($entityBundle) must be of type ?string, int given when entity bundle machine namie is number

Created on 18 September 2023, 9 months ago
Updated 28 March 2024, 3 months ago

Problem/Motivation

On Drupal 9.4 we can see this error when try to add new node with paragraphs.
One of our paragraphs type named "404".
We can see this error:

TypeError: core_event_dispatcher_entity_create_access(): Argument #3 ($entityBundle) must be of type ?string, int given, called in /app/docroot/modules/contrib/hook_event_dispatcher/src/HookEventDispatcherModuleHandler.php on line 76 in core_event_dispatcher_entity_create_access() (line 315 of /app/docroot/modules/contrib/hook_event_dispatcher/modules/core_event_dispatcher/core_event_dispatcher.module)

Steps to reproduce

  • Enable core_event_dispatcher
  • Create paragraph type named 404
  • Add this paragraph type to reference field
  • Try to add node with this paragraph

Proposed resolution

We should cast $entityBundle if exist to string.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇵🇱Poland lamp5 Rzeszow

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024