Problem/Motivation

Currently the available entities to be tracked are limited to ContentEntity types, which makes sense. But the taxonomy_entity_index_entity_delete function is processing on all entity types, not just the content entity ones. This is somewhat related to #3109722: Entity IDs can be strings in Drupal 8 in that it's causing issues because ConfigEntity types use strings for ids instead of numbers. I think it makes sense as a separate issue though, since all the functions of the module should really work with the same subset of entities to make it easier to maintain/test against.

Proposed resolution

Add an instanceOf check around the delete code for that function, that ensures it's a content entity. That's what the attached patch does.

Comments

jacobbell84 created an issue. See original summary.

larowlan’s picture

+++ b/taxonomy_entity_index.module
@@ -25,10 +26,12 @@ function taxonomy_entity_index_field_config_delete(FieldConfig $instance) {
+  if ($entity instanceOf ContentEntityBase) {

Can we check for the interface here instead, ContentEntityInterface

I don't think we need to worry about tests here, so we can get this in pretty quick with the above change

jacobbell84’s picture

Good idea, here's a new patch.

  • larowlan committed 53e3fa0 on 8.x-1.x authored by jacobbell84
    Issue #3272755 by jacobbell84: Entity Deletes don't follow the same...
larowlan’s picture

Status: Needs review » Fixed

Thanks, this will go out as 8.x-1.8

Status: Fixed » Closed (fixed)

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