Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation/User story
Simulate a feed import with selected debug information without actually adding/updating any nodes to preview and test imports.
Proposed resolution
It might make sense to merge https://www.drupal.org/project/feedspreview into feeds core (or as submodule) in this step for 8.x and extend its functionality
UI designs
https://www.drupal.org/project/feeds/issues/2917405#feeds-preview
Remaining tasks
- Decide if https://www.drupal.org/project/feedspreview shoud become part of feeds and if as sub-module or general
=> #9 by @megachriz: "It is my intention that https://www.drupal.org/project/feedspreview would become part of Feeds D8 yes." - Port https://www.drupal.org/project/feedspreview to 8.x to simulate:
- Fetchers
- Parsers
- Processors (Loads the node object just to simulate processing but not updating/saving anything)
- Helpers
- Mapping helpers
& display debug / error information
=> #9 by @megachriz: "I have a rough version of it in my sandbox project: https://www.drupal.org/sandbox/megachriz/2950698" - Add nice-to-have's:
- Preview further / all items (via a site-navigation to reduce load)
- Add an item counter as first row to the table and show the total item count as summary
- Mark lines which could not be validated for preview and show related error messages
User interface changes
TODO
API changes
TODO
Data model changes
TODO
Comments
Comment #1
twistor CreditAttribution: twistor commentedThis is definitely a useful feature.
I think simulating everything is a hard mark to hit in one go.
For a first step, we should just do the fetch and parse stage and print the output. That would be initially useful.
After that, the next step would be simulating created entities.
I don't think mappers need any kind of debugging if we can see what entities are created.
Comment #2
MegaChriz CreditAttribution: MegaChriz commentedI'm working on a prototype for this feature, though currently for D7. I plan to post this as a sandbox module next week (right now I'm too busy with DrupalCon Amsterdam). The module will be simulating fetching and parsing only. Simulating the processing as well is kinda hard to do, because I believe there is no easy way to prevent entity saving and custom processors may do more things in the entitySave() method.
Comment #3
MegaChriz CreditAttribution: MegaChriz commentedIt took a while, but here it is: the Feeds Import Preview module. With this module you can get a preview of the source content before importing. Ideas from this module can be taken to create something similar for the D8 version of Feeds.
Comment #4
MegaChriz CreditAttribution: MegaChriz commentedAlthough there is not yet a patch for the 8.x-3.x available, I set this issue to "Needs review" because there is an idea for implementing this feature that could use a review.
Unassigning for now, as I'm not working on this issue right now, but I would like to implement this feature for 8.x-3.x later.
Comment #5
AnybodyI added the features from #2983339: Improve import preview (suggestions list) which make sense to solve in this step.
Should https://www.drupal.org/project/feedspreview perhaps become part of feeds for D8?
Comment #6
AnybodyComment #7
AnybodyComment #8
AnybodyComment #9
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedIt is my intention that https://www.drupal.org/project/feedspreview would become part of Feeds D8 yes.
I have a rough version of it in my sandbox project: https://www.drupal.org/sandbox/megachriz/2950698
I needed something quick for a client project, so I made something that has a less nice UI and doesn't play well together with the download fetcher.
Comment #10
AnybodyComment #11
AnybodyComment #12
AnybodyI just rewrote the issue to use the issue summary template.
Comment #13
AnybodyComment #14
AnybodyComment #15
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThere are some UI designs that I made for this feature in D8:
https://www.drupal.org/project/feeds/issues/2917405#feeds-preview