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.
If this module is installed on a Drupal 7 site and I use the migrate module to import from a Drupal 6 site (which does not have this module installed), I get a lot of error messages like this:
Undefined index: image_field_caption File /path/to/public_html/sites/all/modules/contrib/image_field_caption/image_field_caption.module, line 221 (file: /path/to/public_html/sites/all/modules/contrib/image_field_caption/image_field_caption.module, line 221)
I don't know if the attached patch is the best approach, but it solved the problem for me. It checks whether $item['image_field_caption'] is set on the incoming node before trying to do the insert. It also fixes a misspelling in a comment.
Comment | File | Size | Author |
---|---|---|---|
#1 | image_field_caption-migrate-2293497-2.patch | 2.41 KB | thebruce |
image_field_caption_migrate.patch | 1.81 KB | rclemings |
Comments
Comment #1
thebruce CreditAttribution: thebruce commentedI also found that if a field was not being migrated that the tests for $entity->field_name would create migration warnings and cause problems, this further check should handle that. Works in tandem with original patch for migration improvements.
Comment #2
iStryker CreditAttribution: iStryker at University of Waterloo commentedMarking all 7.x as out of date. If the problem persists, then only a new issue.