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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3059342_3-4_interdiff.txt | 1.7 KB | pancho |
| #4 | fillpdf_backend_add_plugin_inspection_3059342-4.patch | 15.01 KB | pancho |
| #3 | 3059342_2-3_interdiff.txt | 9.01 KB | pancho |
| #3 | fillpdf_backend_add_plugin_inspection_3059342-3.patch | 15.15 KB | pancho |
| #2 | fillpdf_backend_add_plugin_inspection_3059342-2.patch | 6.87 KB | pancho |
Comments
Comment #2
panchoAdding 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.
Comment #3
panchoNow we're extending PluginBase, we may remove much more boilerplate.
Comment #4
panchoWe need to go a small step back to continue complying with
ContainerFactoryPluginInterface::create().Comment #6
pancho