Problem/Motivation
If you've read the issue title and don't know why that would constitute a bug: setLable() is defined on DataDefinition (the default implementation of the interface) but is not on DataDefinitionInterface. Thus, as soon as contrib implements data definitions that do not subclass DataDefinition, this is going to break.
Proposed resolution
Let's just stop-gap fix any possible fatals here.
Remaining tasks
Postponed on #2346329: hook_entity_base_field_info_alter() and hook_entity_bundle_field_info_alter() are documented to get a parameter that doesn't implement an interface with setter methods, which may fix thix.
User interface changes
-
API changes
-
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2291891-1.patch | 2.94 KB | tstoeckler |
Comments
Comment #1
tstoecklerComment #2
jose reyero commentedRight, that method is not in the interface, but I think we better wait for the outcome of #2225961: Introduce "controlled" setters on FieldDefinitionInterface to avoid special-casing FieldDefinition maybe the add the method to the interface eventually, or if not they should remove it from the base class...
The patch is a bit too much I think, we should just go for $definition['label'] = ...
Anyway, postponing it for now, see what happens with the other issue, I'll keep an eye on this one.
Comment #3
mgifford#2225961: Introduce "controlled" setters on FieldDefinitionInterface to avoid special-casing FieldDefinition is fixed.
Comment #4
mgiffordSorry, think that's just gotten moved to #2346329: hook_entity_base_field_info_alter() and hook_entity_bundle_field_info_alter() are documented to get a parameter that doesn't implement an interface with setter methods
Comment #16
quietone commentedThis is postponed on an issue that has been closed as a duplicate. It is a duplicate of #2346329: hook_entity_base_field_info_alter() and hook_entity_bundle_field_info_alter() are documented to get a parameter that doesn't implement an interface with setter methods. So updating the IS. Like many older issues this needs an issue summary update. Adding tag.