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

  1. 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."
  2. 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"

  3. 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

twistor’s picture

Title: simulating a feed import » Simulating a feed import
Component: Feeds Import (feature) » Code
Priority: Minor » Normal
Issue tags: -simulation

This 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.

MegaChriz’s picture

Assigned: Unassigned » MegaChriz

I'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.

MegaChriz’s picture

It 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.

MegaChriz’s picture

Assigned: MegaChriz » Unassigned
Status: Active » Needs review

Although 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.

Anybody’s picture

I 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?

Anybody’s picture

Issue summary: View changes
Anybody’s picture

Issue summary: View changes
Status: Needs review » Needs work
Anybody’s picture

Status: Needs work » Active
MegaChriz’s picture

It 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.

Anybody’s picture

Title: Simulating a feed import » Simulate & preview a feed import
Issue summary: View changes
Anybody’s picture

Issue summary: View changes
Anybody’s picture

I just rewrote the issue to use the issue summary template.

Anybody’s picture

Issue summary: View changes
Anybody’s picture

Issue summary: View changes
MegaChriz’s picture

Issue summary: View changes

There are some UI designs that I made for this feature in D8:
https://www.drupal.org/project/feeds/issues/2917405#feeds-preview