Problem/Motivation

In some of the test entity types in the entity_test module additional base fields are loaded from state. This allows us to dynamically define base fields in the test environment.

In #2961986: The ContentEntityBase entity key cache is purged incorrectly when two keys exist for one field., we added this capability to EntityTest like so:

  return $fields + \Drupal::state()->get($entity_type->id() . '.additional_base_field_definitions', []);

We are now able to clear up all sub-classes of EntityTest that also merge in these fields from state.

Proposed resolution

Remove instances of \Drupal::state()->get($entity_type->id() . '.additional_base_field_definitions', []); from the following test entity classes:

  • \Drupal\entity_test\Entity\EntityTestMul
  • \Drupal\entity_test\Entity\EntityTestMulRev
  • \Drupal\entity_test\Entity\EntityTestRev

Remaining tasks

Write and review a patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sam152 created an issue. See original summary.

Sam152’s picture

Issue tags: +Novice

Tagging as novice, if anyone has any questions about this task, feel free to ask.

q__nt_n’s picture

Hi @Sam152 !

I try to contribute my first patch.
I applied your proposition and I followed Making a Drupal patch with Git and Contribute a patch guides.

Thank you for your feedback.

q__nt_n’s picture

Status: Active » Needs review
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch, thanks! Patch looks great.

Sam152’s picture

Nice one @q__nt_n. +1 RTBC.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 77703a8 and pushed to 8.6.x. Thanks!

  • catch committed c865944 on 8.6.x
    Issue #2971853 by q__nt_n, Sam152: Clean up superfluous use of "...

Status: Fixed » Closed (fixed)

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