- Issue created by @oppure
- 🇳🇱Netherlands megachriz
For the modern Drupal version, you no longer have Feeds Tamper plugins, but you have Tamper plugins instead. These plugins live in the Tamper → project. Feeds Tamper is now a bridge between the Feeds and the Tamper module. There is no step to step guide for how to write your own Tamper plugin, but there are plugins in the Tamper project that could perhaps be used as an example.
In short:
- Tamper plugins are recommended to be in the namespace
\Drupal\mymodule\Plugin\Tamper
. - Each plugin extends
\Drupal\tamper\TamperBase</code.</li> <li>If your Tamper plugin requires configuration, implement at least <code>defaultConfiguration()
,
buildConfigurationForm()
andsubmitConfigurationForm()
and add config schema for the plugin. Implement validateConfigurationForm() if needed. - Implement
tamper()
to apply the transformation. Return the transformed data. - If you like the plugin to be added to the Tamper module a Unit test that extends
\Drupal\Tests\tamper\Unit\Plugin\Tamper\TamperPluginTestBase
is required and a functional test that extends\Drupal\Tests\tamper\Functional\Plugin\Tamper\TamperPluginTestBase
is required. (With both base classes you already get some test coverage for the plugin, such as if the methods return data of the correct type, if the form for adding a Tamper plugin instance can be submitted without errors and if config schema is correct.)
Does this help? If not, feel free to reopen the issue.
- Tamper plugins are recommended to be in the namespace
Automatically closed - issue fixed for 2 weeks with no activity.