I had a problem importing some file field with the custom title and alt option. It only happens if the field is a part of the data table for the content type. If the field has its own data table to be used in different content types the error does not occur. It seems to get the number of values correcly but attempting to import gives the following error message:

Migration failed with source plugin exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.field_example_alt' in 'field list'

It's because the query is built using the source field info which indicates that these columns are supposed to exist, even though they are not actual columns but data extracted from a single data column. This happens at line 138 of d6/d6.inc :

            // Special handling for the stuff packed into filefield's "data"
            if ($row->type == 'filefield' && $column_name == 'data') {
              $widget_settings = unserialize($row->widget_settings);
              $global_settings = unserialize($row->global_settings);
              if (!empty($widget_settings['custom_alt'])) {
                $columns[$field_name . ':alt'] = $field_name . '_alt';
              }
              if (!empty($widget_settings['custom_title'])) {
                $columns[$field_name . ':title'] = $field_name . '_title';
              }
              if (!empty($global_settings['description_field'])) {
                $columns[$field_name . ':description'] =
                  $field_name . '_description';
              }
            }

I solved this for myself by adding an if statement where the query for the node is built to ignore these columns. It lets the import run but it probably isn't the best solution and you would have to do more work in prepareRow to get the extra text fields imported. Will post a patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmuzz’s picture

Issue summary: View changes
jmuzz’s picture

jmuzz’s picture

Status: Active » Needs review
jmuzz’s picture

FileSize
558 bytes

First patch accidentally included a fix for something else.

mikeryan’s picture

Status: Needs review » Needs work

Wouldn't adding alt and title to the clause just above that (line 98 in the current -dev), alongside list and description, address this?

justindodge’s picture

Status: Needs work » Fixed

For me, the patch that was committed in #2021413: Error handling 'data' column in D6 file fields resolved this issue for me after testing on the latest 7.x-2.x-dev.
Several commenters in that issue report this resolved their Migration failed with source plugin exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.field_example_alt' in 'field list issues were resolved. I'm marking fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.