Problem/Motivation

Current functionality only allows for single node values via given filter types.

Steps to reproduce

1. Use either filters and scrape the markup.
2. The result set in the Migrate Source Plugin is either a single value or the single value of the first node the Crawler finds.

Proposed resolution

Make it possible to fetch multiple values from the Xpath or Selector filters types.

Remaining tasks

1. Review change request
2. Create Patch
3. Review and test functionality
4. Document changes

User interface changes

N/A

API changes

N/A

Data model changes

An updated example with the new fields that feeds into "sub_process" and "migration_lookup" Migrate Processes.

source:
  plugin: php_scraper
  fields:
    categories:
      xpath: '//a/@href'
      get: text
      multiple: true
      key: example_id
  ids:
    - id

process:
  upload:
    plugin: sub_process
    source: categories
    process:
      target_id:
        -
          plugin: str_replace
          regex: true
          source: example_id
          search: /[^0-9]/
          replace: $1
        -
          plugin: migration_lookup
          migration: example_taxonomy_categories

migration_dependencies:
  required:
    - example_taxonomy_categories

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

baikho created an issue. See original summary.

baikho’s picture

Issue summary: View changes
baikho’s picture

Status: Active » Needs review
StatusFileSize
new2.18 KB
reinchek’s picture

Hi @baikho, thank you for your contribution!
Tomorrow, I will test your feature request and, if everything works well, I will create an initial alpha release with the patch merged.
Thanks! 😉