In #3048947: Refactor HandlePdfController::populatePdf(), we're slightly refactoring our backend plugins while supporting custom legacy plugins through a slim BC layer:

    // Turn FieldMapping objects back into legacy field mapping arrays for BC.
    // @todo Remove this BC layer before 8.x-5.x.
    if (!in_array($config->get('backend'), ['fillpdf_service', 'local_service', 'local', 'pdftk'])) {
      $field_mappings = $this->legacyFieldMappings($field_mappings);
    }

Hardcoding the list of converted plugins would however lock custom plugins into the previous API. That's not what we want here.

We however can't introspect backend plugins without implementing PluginInspectionInterface and adding introspection methods, or simply extending PluginBase.

Our backend plugins should therefore extend PluginBase, so once #3048947: Refactor HandlePdfController::populatePdf() is in, any custom plugin may be updated by extending PluginBase as well. This is also another intermediate step towards #3040901: Allow backend plugins to supply settings for the FillPdfSettingsForm.

Comments

Pancho created an issue. See original summary.

pancho’s picture

Status: Active » Needs review
StatusFileSize
new6.87 KB

Adding PluginBase to all our shipped backend plugins minus the test plugin (which remains unchanged to make sure we're still BC).
Preexisting custom backend plugins don't necessarily have to extend PluginBase, but they can do so to upgrade their plugin.

pancho’s picture

Now we're extending PluginBase, we may remove much more boilerplate.

pancho’s picture

We need to go a small step back to continue complying with ContainerFactoryPluginInterface::create().

  • Pancho committed af38bca on 8.x-4.x
    Issue #3059342 by Pancho: Add plugin inspection to backend plugins
    
pancho’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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