ConditionPluginBase::buildConfiguration()
depends on a form state item set by the parent form. This makes the form less portable, and although it may not be a violation of PluginFormInterface
, it means that the plugins' forms are not as easy to embed as PluginFormInterface
suggests.
Let ConditionPluginBase
retrieve available contexts through the context.repository
service itself if no contexts are stored in the form state. This also prevents problems when
#2537732: PluginFormInterface must have access to the complete $form_state (introduce SubFormState for embedded forms) β
is committed, because it would prevent plugin forms from accessing the global form state, and thus the globally set contexts.
The only current usage of this global form state key is in BlockForm::form()
, and that is equivalent to the proposed solution.
Allow the context repository to be optionally injected to ConditionBase
plugins through the constructor, and add a protected ::getContextRepository()
method that uses service location in case the context repository is not injected. This causes a minor break of unit tests of code that calls ConditionPluginBase::buildConfiguration()
, because the context repository is not mocked in those tests yet.
None.
None.
Needs work
10.1 β¨
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.