Problem/Motivation
When configuring plugin selectors, no default selected plugin can be configured.
Proposed resolution
Plugin selectors' default selected plugin should be configuration, so it can be configured in site administration. Make sure that when selecting the default plugin, there's the option of using the system default through DefaultPluginResolverInterface, which PluginSelectorBase currently uses.
Remaining tasks
Just Do It!
User interface changes
PluginSelectorBase's child classes' configuration forms will be expanded with a plugin selector for the default selected plugin.
API changes
None.
Data model changes
PluginSelectorBase's configuration and configuration schema will change. Because configuratoin may be stored in arbitrary places, an upgrade path is not straightforward.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | plugin_2644604_3.patch | 8.67 KB | xano |
Comments
Comment #2
xanoComment #3
xanoThis is a very incomplete first stab. One difficulty to overcome is when using a plugin selector (A) to choose another plugin selector (B). Payment for instance, uses the select list plugin selector to allow site administrators to select and configure the plugin selector (B) users of the payment form field see. However, in order to let B let site administrators select a default payment method, the payment method plugin type must first be set through
B::setSelectablePluginType()by the parent form. If we look at the parent form in this particular situation (\Drupal\payment_form\Plugin\Payment\Type\PaymentFormConfigurationForm), we see that it provides its own top-level configuration form element to let site administrators limit the payment methods that plugin selector B offers to customers. In order to keep this in sync with B's default plugin, we must probably most this configuration option toPluginSelectorBaseas well, so that class manages both the default plugin and allowed plugins configuration options and can keep them in sync itself. The parent class currently usesLimitedPluginDiscoveryDecorator, usage of which would have to be moved toPluginSelectorBase.