Similar to all kind of different plugins managers widgets and formatters should also use defaultpluginmanager.
Possible followups:
- Provide custom annotation for widgets: #2035315: Add a dedicated @FieldWidget annotation
- Switch widget factory to container factory (and adapt all of the plugins, if possible) #2035317: DateTimeDefaultWidget should implement ContainerFactoryPluginInterface
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | drupal-2034563-9.patch | 6.12 KB | dawehner |
| #9 | interdiff.txt | 742 bytes | dawehner |
| #5 | drupal-2034563-5.patch | 6.07 KB | dawehner |
| #5 | interdiff.txt | 927 bytes | dawehner |
| #1 | drupal-2034563-1.patch | 6.07 KB | dawehner |
Comments
Comment #1
dawehner.
Comment #2
larowlanRelease blocker imo
Comment #3
tim.plunkettComment #4
berdirYou don't need this anymore, $this->processDefinition() is called automatically.
Comment #5
dawehnerGood catch!
Comment #6
berdirNice, looks good now!
Comment #8
berdirThis line is the problem, this needs to pass $this to the factory now.
Wondering if we want to change the widget factory to extend from ContainerFactory/implement the same logic there while we're changing this?
Comment #9
dawehnerIf we would remove the custom constructor for widgets by for example moving the field definition instance into the settings or definition, we would not need a custom factory at all anymore.
It feels like the simplest thing for now would be to go with that and open new follow ups. (I am not sure whether constructors are a public api).
Comment #10
berdirAgreed, let's get this in first. Can you open an issue to discuss WidgetFactory? I know that @EclipseGc is also recommending to inline the factory part in your manager when you have specific logic.
Comment #11
alexpottCommitted 8c19f19 and pushed to 8.x. Thanks!
Comment #12.0
(not verified) commentedadded follow ups