- Issue created by @megachriz
- Merge request !56Added itemUsage property for all Tamper plugins, updated 'Copy' and 'Hash'... → (Open) created by megachriz
For the tamper()
method passing a tamperable item as the second parameter is optional. There are however a few Tamper plugins that rely on such an item in order to do their job. Some of these even throw an exception if it is not passed.
The module "ECA Tamper Integration" calls tamper()
without a tamperable item. The issue is that in their UI they list all Tamper plugins, even the ones that happen to be incompatible with their implementation.
The plugins that require a tamperable item are:
Note: for the hash plugin the usage of an item may become optional in 🐛 Hash Plugin returns unhashed values Active .
📌 Make Tamper plugins tell which properties they use of a tamperable item Active is closely related, but that one is specifically about which properties of an item is used. This one is about if the item is used at all.
Introduce a "itemUsage" property for the plugin definition of a Tamper plugin, with the following possible values:
Other modules can check the plugin's definition to see whether or not a tamperable item is required. To make it easier on instantiated plugins, add some methods for it:
These methods are added to a new interface called \Drupal\tamper\ItemUsageInterface and implemented in a trait called \Drupal\tamper\ItemUsageTrait. This way Tamper plugins that do not extend \Drupal\tamper\TamperBase can still make use of this functionality.
None.
All Tamper plugins that implement \Drupal\tamper\ItemUsageInterface get a few new methods.
Tamper plugins get a new property called "itemUsage".
Active
1.0
Code