By pancho on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
8.x-4.x
Introduced in version:
8.x-4.9
Issue links:
Description:
Backend plugins have seen a major overhaul.
These changes will apply to all backend plugins:
- Backend plugins are now auto-discovered. Your custom backend plugin will automatically show up on the settings page without altering
FillPdfSettingsForm. - In your plugin annotation, you may now provide a label, a description and a weight. (implemented in #3044666: Autodetect and present all available backend plugins)
Your own custom backend plugins, if you created any, will continue to work. In order to use new features (like plugin inspection and self-contained configuration) and to prepare your plugin for the next major FillPDF version 8.x-5.x, you should however update your custom plugin:
- Backend plugins now extend PdfBackendBase (implemented in #3060086: Introduce new PdfBackend plugins to replace legacy FillPdfBackend and BackendService plugins).
- The plugin's
populateWithFieldData()method has been replaced bymergeFile()which takes:- a
Fileobject representing the PDF template, while before it took the whole FillPDFForm. - an array of
FieldMappingobjects (TextFieldMappingandImageFieldMapping) as second parameter, while before it took a complex array of field mapping data.
- a
Before:
/**
* @Plugin(
* id = "local_service"
* )
*/
class LocalService implements FillPdfBackendPluginInterface, ContainerFactoryPluginInterface {
Now:
/**
* @PdfBackend(
* id = "local_service",
* label = @Translation("FillPDF LocalServer"),
* description = @Translation("Network-accessible, self-installed PDF API. You will need a VPS or dedicated server."),
* weight = 5
* )
*/
class LocalService extends PdfBackendBase implements ContainerFactoryPluginInterface {
Impacts:
Module developers