Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface, ThirdPartySettingsInterface {
This means that the interface itself does not implement ThirdPartySettingsInterface, so when you type hint on BlockInterface for example, you can't use those methods.
Proposed resolution
Move that to ConfigEntityInterface instead.
Remaining tasks
None
User interface changes
None
API changes
All modules with classes implementing ConfigEntityInterface will have ThirdPartySettings by default.
If a module has an interface extending ConfigEntityInterface and ThirdPartySettingsInterface, it will need to remove the ThirdPartySettingsInterface part.
Beta phase evaluation
Issue category | Task |
---|---|
Issue priority | Not critical |
Unfrozen changes | Unfrozen because it only changes the type hinting of classes extending ConfigEntityInterface |
Prioritized changes | Follow up of #2361775: Third party settings dependencies cause config entity deletion |
Disruption | Non disruptive for contributed and custom modules because even if it's a change, they will only need to remove the ThirdPartySettingsInterface part of the classes extending ConfigEntityInterface |
Comment | File | Size | Author |
---|---|---|---|
#19 | 2425637-19.patch | 7.75 KB | swentel |
#15 | 2425637-15.patch | 7.84 KB | pcambra |
#15 | interdiff-2425637-11-15.txt | 2.16 KB | pcambra |
#11 | 2425637-11.patch | 8.61 KB | pcambra |
#11 | interdiff-2425637-8-11.txt | 2.35 KB | pcambra |
Comments
Comment #1
pcambraSince we're here
Comment #2
BerdirThanks, looks like you included the use removal from the other issue in this patch, so it will probably conflict?
Comment #4
pcambraOops, now should be better.
Comment #6
pcambraReplacing the usage in the rest of interfaces.
As discussed with berdir on IRC, this is a change that will require an action for some contribs.
Comment #8
pcambraHad to convert Drupal\views_ui\ViewUI to abstract.
Comment #9
BerdirThat's not correct, that thing is not abstract. I guess we have to add the trait there or implement the methods properly (meaning, forward to $this->storage).
Comment #11
pcambraThe trait was removed in #2361775: Third party settings dependencies cause config entity deletion appartently so the only option would be to implement the methods, I grabbed them from ConfigEntityBase, not sure if that's what's expected here.
Comment #12
BerdirI think you should forward all calls to $this->storage, see other methods there. ViewsUI is a wrapper class, that *acts* like an entity but it's not one actually.
Comment #14
pcambraBut storage refers to an Entity and not a Config entity in this case (I think) and those have no third party settings, I've tried to forward it to $this->storage->getExecutable or getViewExecutable which are config entities but I'm a little stuck on ViewUIObjectTest fails.
Comment #15
pcambraEverything makes much more sense now, thanks Berdir!
Comment #16
Berdirthanks, looks good to me now.
Needs an issue summary update for the API change and beta evaluation...
Comment #17
pcambraComment #18
pcambraComment #19
swentel CreditAttribution: swentel commentedNeeded a reroll
Comment #20
bojanz CreditAttribution: bojanz commentedThe summary is up to date, the patch looks good. Let's go.
Comment #21
Wim LeersAh yes, I always wondered about that. Makes much more sense :)
Comment #22
alexpottCommitted 27f0b0f and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.