Make Tamper plugins tell which properties they use of a tamperable item

Created on 14 August 2025, about 10 hours ago

Problem/Motivation

In order to fix 🐛 Rewrite plugin doesn't replace "parent" values Active it is necessary that Tamper plugins that make use of a tamperable item, report which fields it uses on such an item. Feeds Tamper can then use that information to lazy load data for some of these fields. To be precise: Feeds Tamper wants to use it to lazy load data from FeedsSource plugins.

Proposed resolution

Add a new interface called ItemUsageInterface with one method called getUsedSourceProperties(). (I have plans to add more methods to it in a follow-up issue, but for the sake of this issue, just that method only.)

The reason to create a new interface, instead of adding the method to the existing TamperInterface, is so that other modules (like Feeds Tamper) can check if the item implements the new interface and then know that they can call getUsedSourceProperties() on it. It's also good for backwards compatibility: classes that implement TamperInterface, but do not extend TamperBase, will not break this way.

All Tamper plugins that make use of the tamperable item, implement that method. These are:

  • absolute_url
  • copy
  • rewrite
  • twig

However, TamperBase will implement the interface. That's because in a follow-up issue I'd like to add more methods that make sense to have for all Tamper plugins.

Remaining tasks

User interface changes

None.

API changes

  • All Tamper plugins from the Tamper module will implement the interface \Drupal\tamper\ItemUsageInterface.
  • All Tamper plugins from the Tamper module will get a new method called getUsedSourceProperties().

Data model changes

None.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands megachriz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024