Problem/Motivation

When trying to do a batch operation with "/admin/config/entity-usage/batch-update" I get the error in the title.

Proposed resolution

The problem is that $entity_type_key = $entity_type->getKey('id') is returning FALSE when

$entity_storage is a ContentEntityNullStorage and
$entity_type is of bundle contact_message from class Drupal\contact\entity\Message

Remaining tasks

Write a patch so that

$id_definition = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($entity_type->id())[$entity_type_key];

does not result in an index error.

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

daniel.pernold created an issue. See original summary.

alexpott’s picture

Interesting. If an entity has no storage tracking usage seems off.

alexpott’s picture

Status: Active » Needs review

alexpott changed the visibility of the branch 3589933-undefined-array-key to hidden.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Contact Message entity type and any other entity type that does not have an ID entity key are no longer trackable. Winning. Thanks for the bug report @daniel.pernold

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

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.

  • alexpott committed 6691106e on 5.x
    fix: #3589933 Undefined array key 0 in /var/www/web/modules/contrib/...

  • alexpott committed 68cccc27 on 8.x-2.x
    fix: #3589933 Undefined array key 0 in /var/www/web/modules/contrib/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.