- Issue created by @i-grou
- π³π±Netherlands megachriz
The feeds_item field is very much coupled to how the Feeds processor works currently so I think that it would take a quite some effort to make it optional.
Start with creating a custom FeedsProcessor plugin
You are welcome however to find a solution to use Feeds without using a feeds_item field. For that I would recommend to start with writing a custom FeedsProcessor plugin. Because most of the feeds_item field's usage is tied to how
\Drupal\feeds\Feeds\Processor\EntityProcessorBase
works (and all FeedsProcessor plugins that extend this class). You could create a duplicate of EntityProcessorBase and then strip out everything that is feeds_item related.Some FeedsTarget plugins also expect that the feeds_item field exist. These are the entity reference targets and the book target. We could probably add an extra check for if the field exists. And then skip the action in case it doesn't exist. For example, the entity reference target clears the hash on the feeds_item field in case the referenced entity is not found. It doesn't hurt the basic functionality of Feeds if we should skip that action. The hash gets cleared only to retry importing the referenced entity on a next import. And with no feeds_item field in place, there would be no "next" import of the same content: all data would then be considered new on each import as checks for if something was already imported before would be skipped.
These FeedsTarget adjustments is what we could focus on in this issue first. I expect these adjustments to be quite small, so that would be some easy wins to resolve in Feeds. I recommend to also add test coverage for it so that these targets can keep working without the feeds_item field in future Feeds releases.
After having written a custom processor and having updated the FeedsTarget plugins, it's time to test if this works for you. It is possible that you face some other issues along the way, maybe there exists more code that expect the presence of the feeds_item field. When these are resolved, we could consider to add this feature to Feeds. You could also decide to keep it as a custom solution, if you're fine with that. Though with future Feeds releases there is always a chance that it would break. But that essentially applies to all customizations that changes Feeds behavior on a bit deeper level.
I hope that this give you enough pointers to start working on a solution yourself. :)
- π·πΊRussia i-grou
Thanks @MegaChriz for your reply and suggestions.
I think I'll go ahead with Trucie (True Content Import) β module for now as it fully meets my needs.
- πΊπΈUnited States irinaz
@i-grou, you might also take a look at https://www.drupal.org/project/feeds_migrate β which is UI on top of Migrate. It is dev module and processors have UI but are not connected, it might cover more use cases when ready.