Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
When i run drush command for migration
"drush mi migration_id", then getting warning "Invalid argument supplied for foreach() Migration.php:352"
Comment | File | Size | Author |
---|---|---|---|
#18 | 2886349-18.patch | 2.04 KB | quietone |
#18 | interdiff-16.18.txt | 1.05 KB | quietone |
#16 | interdiff-13-16.txt | 2.26 KB | quietone |
#16 | 2886349-16.patch | 2.07 KB | quietone |
#13 | 2886349-13.patch | 3.13 KB | quietone |
Comments
Comment #2
mikeryanCould you provide the .yml for the migration that's giving you this warning? Thanks.
Comment #3
PunamShelkeI have attached .yml file,
Comment #4
mikeryanPlease be sure to reset the status when replying to a "Postponed (maintainer needs more info)" issue.
Comment #5
mikeryanI feel like there must be something funky in how the process pipeline is laid out in YAML to trigger this, but I can't see it (I do see "author : administrator" with an unwanted space before the colon, but don't see how that would cause this error).
At any rate, not a bad idea to bulletproof the code here. We do need a test demonstrating the problem though (so, still need to diagnose why it's happening to you).
Space after "if".
Comment #6
PunamShelkeHi,
I found that issues
field_name:
-
plugin: get
source: ContentOwner
After Changing the field mapping that warning get fixed but the getting new warning
"Invalid argument supplied for foreach() Get.php:112"
record get migrated properly but getting this warning.
For this warning i did change mapping like this
field_name:
-
plugin: skip_on_empty
method: process
source: ContentOwner
-
plugin: get
source: ContentOwner
but still i m getting the same warning....
any idea how to fix it.....
Comment #7
quietone CreditAttribution: quietone as a volunteer commentedThe spacing looks wrong to me in this section of the yml.
Comment #8
PunamShelkeThanks
Comment #12
quietone CreditAttribution: quietone as a volunteer commentedAdding a test.
Comment #13
quietone CreditAttribution: quietone as a volunteer commentedAnother option is to thrown an exception when the process pipeline has an error.
Comment #15
heddnRather then nesting further, can we do a !is_array and throw the exception? It is a nit, but will make the code more readable.
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedYes, that would be better.
Comment #17
heddnLet's combine these as a single if statement.
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedSure thing.
Comment #19
heddnLet's assume this is green. On to rtbc.
Comment #21
catchCommitted b147d5e and pushed to 8.8.x. Thanks!