in order to provide a stable API for alpha1, we need to remove ambiguity of some methods names, and rely on interfaces as much as possible.

Following #3413703: [2.0.0-alpha1] Source plugin manager: methods naming and interfaces use

Current investigation. Let's talk about this.

  • Use PluginFormInterface::buildConfigurationForm() in source plugins instead of SourcePluginBase:buildSourceConfigurationForm(), moving the wrapping of SourcePluginBase::buildConfigurationForm() into the form builder. So, every expected methods in a plugin class belong to a defined interface
  • PluginFormInterface::validateConfigurationForm() is not used by the form builder. are we missing something?
  • ContextAwarePluginInterface methods are not used by the Form Builder, only internally by SourcePluginBase. is it normal ?
Command icon Show commands

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

pdureau created an issue. See original summary.

pdureau’s picture

Use PluginFormInterface::buildConfigurationForm() in source plugins instead of SourcePluginBase:buildSourceConfigurationForm(), moving the wrapping of SourcePluginBase::buildConfigurationForm() into the form builder. So, every expected methods in a plugin class belong to a defined interface

It is currently done in #3395953: [2.0.0-alpha1] Add new Form Builder

So, the remaining parts of this issue are:

  • PluginFormInterface::validateConfigurationForm() is not used by the form builder. are we missing something?
  • ContextAwarePluginInterface methods are not used by the Form Builder, only internally by SourcePluginBase. is it normal ?
pdureau’s picture

Assigned: Unassigned » christian.wiedemann

Christian, following the form builder refactor, can you answer those 2 questions?

pdureau’s picture

Status: Active » Needs work

this one was resolved by the new interface baed on settingsForm():

PluginFormInterface::validateConfigurationForm() is not used by the form builder. are we missing something?

Last question: "ContextAwarePluginInterface methods are not used by the Form Builder, only internally by SourcePluginBase. is it normal ?"

pdureau’s picture

Also: add default "value" key in each source plugin forms.

Like content field properties, there is always at least a key, and this one is "value" by default.

Christian.wiedemann made their first commit to this issue’s fork.

christian.wiedemann’s picture

Status: Needs work » Needs review
pdureau’s picture

pdureau’s picture

Status: Needs review » Needs work

After rebasing #3420653: [2.0.X-alpha1] Introduce buildComponentRenderable, there are a few issues left:

  • variant selector is not working: variant selection is not saved and retrieved
  • after refreshing the page, all the form is reset expect the component selector

Those issues were already there before the additional commits.

Also: remove useless references (&$foo)

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

christian.wiedemann’s picture