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
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
Comment #3
berdirMerged this already through #3581883: [PHP 8.5] Warning with dynamic_entity_reference fields