Needs work
Project:
Plugin
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2021 at 16:49 UTC
Updated:
21 May 2025 at 15:27 UTC
Jump to comment: Most recent
Currently the "Plugin selector" functionality is tied to a field widget. It would be nice to have a form element that may be used in any form to select and configure plugins. This element can then be reused in the plugin selector widget.
n/a
n/a
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
hctomComment #3
hctomComment #4
joachim commentedThat's a good idea.
Have a look at src/Element/PluginConfiguration.php in Commerce module. We should work towards converging with the plugin support in Commerce with a view to getting something into core eventually.
Comment #5
hctomComment #7
joachim commentedGot something working!
Enable the test module and go to /configured-plugin-form-element to see it in action.
It produces a complete plugin selection with configuration form element for just this in your form:
Still to do:
- tests!
- make the field widget use it
- maybe identify which plugins can't use this? So far I've found the field plugins won't work because the plugins have a nonstandard constructor.
Comment #9
milos.kroulik commentedI've tried to fix minor issues. Hopefully it makes sense.
Comment #10
joachim commentedThanks for your fixes to the branch @milos.kroulik !
I'll look at the issues you've raised when I have more time.
Comment #11
joachim commentedUntil this gets committed, copying the class into a module and hardcoding a few things is a viable option :D
https://git.drupalcode.org/project/computed_field/-/blob/4.0.x/src/Eleme...