In d6.inc, there's a bit of code which does the following to determine whether or not it needs to add additional file columns when doing a source query against a file table:

$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';
}

There is a problem with this, however, because sometimes those columns don't exist *and* the $widget_settings indicate custom data. I've run into this on the imagefield widget. Since the columns don't exist I get this error when attempting to run the migration:

Column not found: 1054 Unknown column &#039;f.field_photo_image_alt&#039; in &#039;field list&#039;</em>, in <em
class="placeholder">/var/www/includes/database/database.inc</em>:<em class="placeholder">2171</em>

We should check to see if the columns actually exist before adding them to the $columns array.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cthos’s picture

Status: Active » Needs review
FileSize
1.87 KB

This patch should address the issue of not adding the columns. I'm not so sure if the `data` field properly gets expanded in other situations though.

  • mikeryan committed dba43d8 on 7.x-2.x authored by cthos
    Issue #2313985 by cthos: Validate presence of columns for subfields
    
mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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