Closed (fixed)
Project:
Drupal core
Version:
main
Component:
documentation
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2013 at 07:56 UTC
Updated:
15 Oct 2026 at 14:25 UTC
Jump to comment: Most recent
API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Plug...
Make following the pathway of plugin construction clearer if the parameters were explained with this in mind:
- $configuration is the configuration array that is passed to the plugin manager's createInstance() method
Also adds a link to the direct plugin definition API docs.
Follow up issue: #3627409: Explain the extra items that are passed to PluginBase::__construct() in the $plugin_definition array besides the plugin configuration
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 #1
jhodgdonGreat idea!!!!!!!!!!
Comment #1.0
joachim commentedunsure about 'provider'
Comment #12
larowlanYes provider is the module
Comment #16
royalpinto007Comment #18
royalpinto007Comment #19
joachim commentedThanks for the MR. Needs a little bit of work.
Comment #20
royalpinto007Sure, I will make the required changes.
Comment #21
royalpinto007Thank you for reviewing and identifying the mistakes in the parameter definition. I have now updated the definition to fix those mistakes. I appreciate your help in making this better!
Quite unsure about the YAML plugins, can be added to the MR later on.
Comment #22
royalpinto007Comment #23
smustgrave commentedMR has a valid failure it seems.
Comment #24
royalpinto007Comment #25
royalpinto007Comment #26
royalpinto007Comment #29
xjmThe Drupal Contribution Mentoring team is triaging issues for DrupalCon Rotterdam 2026, and we are reserving this issue for Mentored Contribution during the event.
After October 3, this issue returns to being open to all. Thanks!
The merge request here was closed for being very old, but the documentation addition is still relevant as far as I can tell. The diff from the old merge request does not apply, but a new merge request could be created with these documentation additions on the class constructor for
core/lib/Drupal/Component/Plugin/PluginBase.php:So, the novice task for this issue would be to edit
core/lib/Drupal/Component/Plugin/PluginBase.phpto add the above helpful documentation, and then create a new branch in the issue fork for those changes.Setting active since there is no relevant merge request at the moment. Thanks everyone!
Comment #30
joachim commentedThe MR's branch could probably be rebased. As it's docs, I don't image that much has changed.
Comment #31
xjmHonestly I recommend just manually adding the changes over trying to rebase across so many branches; the changeset is so small. The lines need reformatting anyway to wrap properly (starting on the same line as the existing docblock, rather than a separate line).
Comment #32
xjmComment #33
griff phillips commentedWorking on this item at Drupalcon Rotterdam 2026 today with mentor ekes
Comment #34
kristiantosney commentedI am at DrupalCon Rotterdam 2026, today I will be working on this issues. My mentor is Ekes.
Comment #35
kristof de weyer commentedI am at DrupalCon Rotterdam 2026, today I will be working on this issues. My mentor is Ekes.
Comment #36
griff phillips commentedI have pushed branch 2079245-explain-the-extra-12.0.x which contains these documentation changes. Leaving now - other contributors can take over.
Comment #38
kristiantosney commentedMerge request with updated argument description can be found here: https://git.drupalcode.org/project/drupal/-/merge_requests/17304
Comment #42
kristof de weyer commentedWe worked on it and fixed the comment and changed the calling function to \Drupal\Component\Plugin\Factory\FactoryInterface::createInstance() so it does not reference core anymore as that is not allowed.
the replacement was found with the help of an LLM and reviewed to be correct.
Comment #43
xjmGreat work on this everyone!
Now that it is Needs review, the next step is for a more experienced member of our community to RTBC it. In this case, a subsystem maintainers's feedback would be good to ensure the info is correct after all this time (I think it is, but want to be sure).
Tagging for subsystem maintainer review and I'll look for one of them since they're here. 😉
Comment #44
joachim commentedThese points haven't been covered:
> - class: the class of the plugin
> - provider: the module where the plugin is defined? or the module that defines the plugin type?
Comment #45
xjm@joachim, since this is an issue for contribution day and first-time contributors, let's create a separate followup issue.
NW for @timplunkett's feedback. Thanks!
Comment #46
ekes commentedFollow-up #3627409: Explain the extra items that are passed to PluginBase::__construct() in the $plugin_definition array besides the plugin configuration for the additional arguments. Tim has reviewed the text to this point.
Comment #47
aurora-norris commentedComment #48
xjmComment #49
xjmComment #50
xjmComment #51
xjmComment #52
xjmComment #57
xjm