The naming of Drupal\ctools\Plugin\Condition\EntityType makes no sense, it also still has 'Node Type' in some of the comments.
It should be called EntityBundle or maybe just Bundle. It's about checking the bundle of an entity and not the entity type.
Additionally, the deriver shouldn't be checking the bundle entity types but instead look for a 'bundle' entity key and use getBundleLabel(). bundle_of/bundle_entity_type are optional, bundles usually are but must not be entity types.
Major because this prevents me from fixing the userpoints tests.
Attaching a minimal patch that adds the config schema but I really think this should be renamed and cleaned up before people start using it.
Comment | File | Size | Author |
---|---|---|---|
#6 | ctools-entity-bundle-rename-2615138-1.patch | 7.41 KB | Berdir |
entity-type-schema.patch | 493 bytes | Berdir |
Comments
Comment #2
EclipseGc CreditAttribution: EclipseGc commentedcommitted.
Comment #4
BerdirThanks, keeping this issue open for now, I'l try to provide a patch to rename things.
Comment #6
BerdirHere's a patch, some explanation in next ocmment.
Comment #7
BerdirUsing the new services. Also bundleType is no longer needed.
This part is tricky. Two problems:
a) "@entity_type @bundle_type" IMHO leads to weird double names: "content content type" or "custom block custom block type". So I think just the bundle label is enough.
b) lowercasing labels is problematic because that is only correct for english, in german, they have to stay uppercase. There are some pending issues around that. for the label, there's a special method but that actually has the same problem. it doesn't exist for bundle label, though. So I tried to leave out the The so that it can be at the beginning of the sentence. Not really sure about tha, maybe it could also be changed to not be a sentence but just "Node type: A, B or C" ?
This changes the plugin ID from entity_bundle:node, so the bundle of node, which I think makes a lot more sense than entity_type:node_type, which sounds like it checks that the entity type is node_type?
Comment #8
EclipseGc CreditAttribution: EclipseGc commentedLooks good!
Fixed
Eclipse