Problem/Motivation

With PHP8.5 I get the following deprecation Warning on status page:
( ! ) Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/web/modules/contrib/token/src/TokenEntityMapper.php on line 72

It seems that $entity_type can be NULL in getTokenTypeForEntityType in some scenarios. I could track this down to https://www.drupal.org/project/dynamic_entity_reference module not providing an entity_type which makes sense. I am not sure if this is the right place to fix this though.

Steps to reproduce

- Install dynamic_entity_reference and token
- Go to /admin/reports/status

Proposed resolution

- Add type check to dynamic_entity_reference
- Make sure tokens are only created if a reference entity type exists

Issue fork token-3576481

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hydra created an issue. See original summary.

berdir’s picture

Status: Needs review » Closed (duplicate)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.