- Issue created by @duaelfr
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
Thanks for the issue.
I think you have more deep dived into those plugins mecanism than me.
I agree that it is confusing to have on one almost emply plugins which only declares fields and on the other side plugins which need to use the first plugins and then load themselves the data.
I propose either:
- 1) do as you proposed and it is the plugin declareing the field that is also repsonsible to provide the data
- 2) remove the source pluginsBut as mentioned, I think you have more manipulated Ui patterns plugins than me.
- Status changed to Needs work
about 1 year ago 9:13am 23 October 2023 - Assigned to duaelfr
- Status changed to Needs review
about 1 year ago 3:25pm 26 October 2023 - 🇫🇷France pdureau Paris
We have a new source plugin in UI Patterns 2.x which is now able to retrieve the data:
/** * Returns the processed source plugin data. */ public function getData(): mixed;
Source: https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/SourceIn...
Because form widgets (successor of UI Patterns Settings plugins) are also source plugins, the base plugin implementation will often be good enough:
public function getData(): mixed { $configuration = $this->getConfiguration(); return $configuration["form_value"] ?? NULL; }
Source: https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/SourcePl...
Some plugins will override this method to do more complex processing. Example: https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/Plugin/U...
Dualefr, is it what you expected?
- Issue was unassigned.
- Status changed to Fixed
9 months ago 4:27pm 29 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.