I test on local the D6/D7 upgrade path
When trying to migrate autocomplete_widgets fields I get the following PDO exception.

• Error creating field field_responsable
• exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de ') NULL DEFAULT NULL, `field_responsable_format` VARCHAR(255) NULL DEFAULT NULL,' à la ligne 9' in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\database\database.inc:2135 Stack trace: #0 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\database\database.inc(2135): PDOStatement->execute(Array) #1 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\database\database.inc(664): DatabaseStatementBase->execute(Array, Array) #2 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\database\schema.inc(656): DatabaseConnection->query('CREATE TABLE {f...') #3 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\database\database.inc(2684): DatabaseSchema->createTable('field_data_fiel...', Array) #4 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\modules\field\modules\field_sql_storage\field_sql_storage.module(216): db_create_table('field_data_fiel...', Array) #5 [internal function]: field_sql_storage_field_storage_create_field(Array) #6 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\module.inc(794): call_user_func_array('field_sql_stora...', Array) #7 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\modules\field\field.crud.inc(176): module_invoke('field_sql_stora...', 'field_storage_c...', Array) #8 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\sites\all\modules\cck\modules\content_migrate\includes\content_migrate.admin.inc(239): field_create_field(Array) #9 [internal function]: _content_migrate_batch_process_create_fields('field_responsab...', Array) #10 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\batch.inc(284): call_user_func_array('_content_migrat...', Array) #11 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\batch.inc(161): _batch_process() #12 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\batch.inc(80): _batch_do() #13 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\modules\system\system.admin.inc(2333): _batch_page() #14 [internal function]: system_batch_page() #15 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\includes\menu.inc(503): call_user_func_array('system_batch_pa...', Array) #16 C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdb11Mig1\index.php(21): menu_execute_active_handler() #17 {main}

Do you understand what is the problem?

Comments

sahuni’s picture

Because my website has just 4 fields with autocompletion, I can change the widget to text field, then upgrade to D7 and then redo autocomplete. So I'm not blocked. But it's not a solution to that code issue.

mustanggb’s picture

Priority: Normal » Major
mustanggb’s picture

Seems like they are being converted from longtext (text_long) to varchar (text) with an empty length. They should probably remain as longtext.

mustanggb’s picture

Status: Active » Needs review
StatusFileSize
new700 bytes

Something like this perhaps.
IGNORE

mustanggb’s picture

Lets try that again.

boobaa’s picture

Looks like this can, therefore should be done in autocomplete_widgets_content_migrate_field_alter(), but I'm not really sure about it. I have ran into the same issue while upgrading a site that uses text_noderef.module, and the following code have solved it for me (gonna commit it later on into that module, when I'm totally satisfied with all the results):

/**
 * Implements hook_content_migrate_field_alter().
 */
function text_noderef_content_migrate_field_alter(&$field_value, $instance_value) {
  if (($field_value['type'] == 'text') && ($instance_value['widget']['type'] == 'text_noderef_textfield') && empty($field_value['settings']['max_length'])) {
    $field_value['type'] = 'text_long';
  }
}

OTOH, this raises the question if this issue should and/or could be solved in general, leaving it in the state I've found.

aleagi’s picture

Subscribe

jromine’s picture

colan’s picture

Issue summary: View changes
Status: Needs review » Closed (works as designed)

Looks like it's not CCK's problem anymore, but at least the bug in the other queue is fixed.