Updated: Comment #N
Problem/Motivation
The code is still based on the old assumption that fields can be re-used for other entity types and relies only on the entity keys and not the base fields.
Proposed resolution
1. Only check the entity type the field is attached to.
2. use \Drupal::entityManager()->getFieldDefinitions($entity_type) of the entity manager to check for a conflict with all base fields.
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | interdiff.txt | 897 bytes | swentel |
| #10 | 2199811-10.patch | 5.76 KB | swentel |
| #5 | interdiff.txt | 1000 bytes | swentel |
| #5 | 2199811-5.patch | 5.76 KB | swentel |
| #3 | 2199811-3.patch | 5.87 KB | swentel |
Comments
Comment #1
swentel commentedHere we go. I've added a test to the Field UI tests because this also fixes an error in FieldOverview which would blow up very easily when trying to show the message with the error. Also cleaned up a leftover todo in FieldTypePluginManager along the way.
Comment #2
swentel commentedOk, this needs a reroll now the field class rename patch is in of course.
Comment #3
swentel commentedReroll
Comment #4
berdirBest forgotten @todo ever :)
Everything on a content entities is a field, so there can't be a key that is not also a field, so the first line shouldn't be necessary.
Comment #5
swentel commentedRight, duh, where's my mind.
Comment #6
berdirNow it looks great :)
Comment #7
berdir5: 2199811-5.patch queued for re-testing.
Comment #8
alexpottWe can use getBaseFieldDefinitions() here.
Comment #10
swentel commentedComment #11
berdirThanks, back to RTBC.
Comment #12
alexpottCommitted 7099e22 and pushed to 8.x. Thanks!