1

I'm working with Migrate. On my json source file I've the alias of the node to import. There are nodes that does not have an alias, so in the json I've things like "/node/1234". So I want to skip this alias (not the entire node).

Is there a way to do this?

I'm already using custom process but I don't know how to skip a single value.

  • Ok, I create a custom process function to check the value. If it doesn't match my requirements, the function returns blank. Works:) – arrubiu Jun 12 '17 at 8:08
2

Use skip_on_value plugin in Migrate Plus module.

Sample code:

id: custom_menu
label: Menu
migration_group: custom
migration_tags:
  - Drupal 7
source:
  plugin: menu
process:
  id:
    -
      plugin: skip_on_value
      equals: true
      source: menu_name
      method: row
      value:
        - devel
        - features
    -
      plugin: static_map
      bypass: true
      source: menu_name
      map:
        main-menu: main
        management: admin
        navigation: tools
        user-menu: account
  label: title
  description: description
destination:
  plugin: entity:menu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.