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.
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 'f.field_photo_image_alt' in 'field list'</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.
Comment | File | Size | Author |
---|---|---|---|
#1 | migrate_d2d-imagefield_missing_cols-2313985-1.patch | 1.87 KB | cthos |
Comments
Comment #1
cthos CreditAttribution: cthos commentedThis 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.
Comment #3
mikeryanCommitted, thanks!