After visiting @alexpott's session "Drupal 9 is coming: Getting your code ready
" (https://events.drupal.org/seattle2019/sessions/drupal-9-coming-getting-y...) in Seattle, I wanted to make the contrib select2 module more BC stable by preventing constructor overwrites.
I found out that I am not able to prevent constructor overwriting for the Select2EntityReferenceWidget
(https://git.drupalcode.org/project/select2/blob/8.x-1.x/src/Plugin/Field...) because none of it's base classes is implementing the ContainerFactoryPluginInterface
.
The base class chain of this class is Select2EntityReferenceWidget -> Select2Widget -> OptionsSelectWidget -> OptionsWidgetBase -> WidgetBase
. That means if one of this base classes changes it's constructor, I will have a breakage in Select2EntityReferenceWidget
.
Add ContainerFactoryPluginInterface
to Drupal\Core\Field\WidgetBase
and Drupal\Core\Field\FormatterBase
and implement the ::create()
method in them. The big advantage is that all child classes will be more BC stable.
Discuss
Implement
Test
Commit
n.a.
Add ContainerFactoryPluginInterface to Drupal\Core\Field\WidgetBase
n.a.
n.a.
Fixed
8.8 β°οΈ
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.