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.
Comment | File | Size | Author |
---|---|---|---|
#3 | core-clean-up-2971853-3-D8.patch | 2.2 KB | q__nt_n |
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedTagging as novice, if anyone has any questions about this task, feel free to ask.
Comment #3
q__nt_nHi @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.
Comment #4
q__nt_nComment #5
tstoecklerNice catch, thanks! Patch looks great.
Comment #6
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedNice one @q__nt_n. +1 RTBC.
Comment #7
catchCommitted 77703a8 and pushed to 8.6.x. Thanks!