In Drupal 6 an image item or image cache item can contain multiple images. I know that single images migrate properly, however I get at least one error on image widgets that contain a list of images. The following are messages from a single ubercart product item that contained multiple images in the field_image_cache field. The most common error I see is the Field Validation errors message.
Informational Undefined offset: 12 File /home/spe2sp/public_html/modules/taxonomy/taxonomy.module, line 1530(file: /home/spe2sp/public_html/modules/taxonomy/taxonomy.module, line 1530)
Trying to get property of non-object File /home/spe2sp/public_html/modules/taxonomy/taxonomy.module, line 1530(file: /home/spe2sp/public_html/modules/taxonomy/taxonomy.module, line 1530)
Field validation errors (/home/spe2sp/public_html/modules/field/field.attach.inc:801)
Comments
Comment #1
mikeryanHow are you mapping the image fields - through the UI or through code? What are the specific field mappings you've set up? Regarding the field validation errors, what constraint(s) have you set on the destination image field? Is it set to required?
Comment #2
pcher1bw commentedField is not required.
The field mappings are in code, the following is declared in an abstract class that applies to 17 content types / product types that are being migrated. Currently I do not have any code for uc_product_image or field_image_cache in prepareRow() or prepare(). Receiving widget type in D7 is image, sending widget type in D6 is also image.
Debugging code using watchdog shows me this in prepareRow().
Comment #3
pcher1bw commentedComment #4
mikeryanOK, the incoming data looks good. The next thing to try is seeing how the destination object has been populated:
Comment #5
pcher1bw commentedMy mistake, the problem is not with images, it is with taxonomy references. In the prepareRow & prepare debug info the TID for 8/field_product_collection remains 126, which will cause the validation to fail (126 should map to 316). Do I need the source taxonomy ('8') in the field mapping for source_type, create_term and ignore_case?
The following code works fine:
This taxonomy reference does not always work:
prepareRow Debug info (row)
prepare Debug info (node)
Comment #6
pcher1bw commentedComment #7
mikeryanOK, so taxonomy_catalog got properly translated from the source tid to the destination tid, but field_product_collection did not. The first thing to check is the map table you're referencing with sourceMigration('Collections') (presumably migrate_map_collections) and make sure the expected mapping is there for sourceid1=126. If it is, my next step would be debugging handleSourceMigration() to figure out why it's not getting that value.
Comment #8
mikeryanComment #9
mvlabat commentedI've met the same issue when a taxonomy reference field had wrong vocabulary machine name. It happened because of using a broken feature (Features module).
Try recreating your field, this may solve your problem.
Comment #10
mvlabat commentedP.S. If that caused this issue we may set "Closed (works as designed)".
Comment #11
mikeryanRestoring appropriate status.
Comment #12
shaundychkoI had a similar problem caused by using Taxonomy Access Control. The "Anonymous" user needed permission to add the taxonomy term since the migration runs as Anonymous.