Problem/Motivation

When I have a series of sub-processes, they don't get linked in the graph.

It seems to be because each sub-process is handled separately form the others, and since they don't have a 'source' attribute (aside from the very first sub-process), the code doesn't know how to find the previous/source vertex.

Steps to reproduce

Create a migration with the following bit in `process`:

process:
  nid:
    # Look up the node.
    - plugin: entity_lookup
      entity_type: node
      bundle_key: type
      bundle: article
      value_key: field_uuid
      source: raw/article_uuid
    # Skip if we don't find this node.
    - plugin: skip_on_empty
      method: row

Proposed resolution

Make `MigrateGraph::graphProcessPlugin()` return the vertex it just created, and pass that vertex to the next call for the next sub-process in the same chain.

Remaining tasks

Implement solution.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

khaled.zaidan created an issue. See original summary.

khaled.zaidan’s picture

Here's a patch with the fix proposed in the description.

Also before and after screenshots of a test migration.

before screenshot

after screenshot

khaled.zaidan’s picture

Status: Active » Needs review
khaled.zaidan’s picture

Here's a modified patch that also links processes to their source if it's from another process.

xurizaemon made their first commit to this issue’s fork.

xurizaemon’s picture

Thanks heaps Khaled! Nice fix.

xurizaemon’s picture

Status: Needs review » Fixed
xurizaemon’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.