Score:1

Migrate Module: How skip whole item (not value)

cn flag

I have a xml file that creates nodes via migrate.

I need to define the following:

Each job has a field "location". I have written a process plugin to process the value When the returned value is "null" ... skip the row (not just the field - skip the whole job item) I thought I do it right by using this yml structure / script

process:

  _job_location:
    - plugin: process_job_location
      source: src_job_location
    - plugin: log

  field_job_location_ref:
    - plugin: skip_on_empty
      method: process
      source: _job_location

_job_location (the processor) returns "null" - still the whole item / node is created. Seems that skip_on_empty does just skip the field itself.

How to skip the whole creation of the node?

Thanks

Score:1
us flag

Using method: process in the plugin config will use the process() method in the plugin which throws a MigrateSkipProcessException when a field is empty and that will only skip the field.

Using method: row will use the row() method which throws a MigrateSkipRowException on empty field and the migration will skip the whole row.

So use method: row for the plugin config.

mogio avatar
cn flag
THANKS. This seems to work.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.