- Issue created by @partyka
- π³π±Netherlands megachriz
Interesting issue. As I'm not familiar with the Trash module yet, I'm not sure what the best way is to solve this problem. If possible, I would like to avoid the soft dependency on the Trash module, because making sure the Trash specific code keeps working would require tests and a dev dependency on the Trash module. Also, I'm aiming for a pass on PHPStan. With the current implementation, I think that will mean that eventually all child classes of FieldTargetBase would need to pass the Trash service instance to the parent. See π (PHPStan) Add dependency injection for FieldTargetBase and add deprecation warnings Active for other services I've planned to inject in FieldTargetBase in the future (and require them in Feeds 4.x).
One thing we could do instead, but I'm not sure if that's enough, is add a query tag to the query that Feeds executes, for example:
$query->addTag('feeds_unique_query');
This tag would then always be added.
In theory, you could then implement
hook_query_TAG_alter()
to perform the Trash specific code, though I don't know if adding another query tag in such implementation has the desired effect.