2011-07-08 8 views
1

基本的には、drupal 6サイトの一部をdrupal 7ビルドに移動したかったのです。移行モジュールの使用。drupal 6からdrupal 7への移行

291 Error PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'tid' at row 1: INSERT INTO {taxonomy_index} (nid, tid, sticky, created) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ([:db_insert_placeholder_0] => 3057 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => 1282050381) in taxonomy_field_insert() (line 1675 of /u01/facebase/drupal-7.0/modules/taxonomy/taxonomy.module). 

291エラーSQLSTATE [HY000]:一般的なエラー:1366が正しくないと彼らのコメントや分類で155のノード(2 vocabs、1が固定されている他は、カンマ区切りで)最後の30は、私は、このエラーを与える失敗の移行中整数値:「私はこのクエリを使用して、私の用語を移行しています行1

でTID」「列に」:、私は2つの語彙のためにこれを行う、その後、私はちょうど名前をマップ

$query = db_select("$this->_db.term_data", 'td') 
    ->fields('td', array('tid', 'name', 'weight')) 
    ->condition('v.vid', 7); 
    $query->innerJoin("$this->_db.vocabulary", 'v', 'td.vid=v.vid'); 

フォーマット、および重量。そして、私はこのような各語彙のためterm_listをマッピングしてい

$query = db_select("$this->_db.node", 'n') 
    ->fields('n', array('nid', 'vid', 'type', 'title', 'uid', 'status', 'created', 'changed', 'comment')) 
    ->fields('tn', array('tid')) 
    ->fields('nr', array('title', 'body', 'teaser')) 
    ->condition('n.type', 'dev_content'); 

    $query->leftJoin("$this->_db.term_node", 'tn', 'tn.vid =n.vid'); 
    $query->leftJoin("$this->_db.node_revisions", 'nr', 'nr.vid = n.vid'); 
    $query->addExpression('GROUP_CONCAT(DISTINCT tn.tid)', 'term_list'); 
    $query->groupBy('n.nid'); 

$this->addFieldMapping('field_dev_tags', 'term_list') 
->separator(',') 
->sourceMigration('DevCenterTerm') 
->arguments(array('source_type' => 'tid')); 

$this->addFieldMapping('field_dev_category', 'term_list') 
->separator(',') 
->sourceMigration('DevCenterTermPrep') 
->arguments(array('source_type' => 'tid')); 

私はこれが原因条項に起こっている知っているように、ノードを移行しながら、私はこのクエリを使用しています私はterm_listをマップしないと、すべてのノードが作成されますが、それについてはそれがあります。何か案は?

答えて

0

タクソノミが割り当てられていないノードでこの問題が発生していますか?このような場合は、分類フィールドマッピングにデフォルト値を追加してみてください。 beer.inc例で

$this->addFieldMapping('field_dev_category', 'term_list') 
->separator(',') 
->sourceMigration('DevCenterTermPrep') 
->arguments(array('source_type' => 'tid'))->defaultValue(12); 

、これは、コメントに記載されている:

You can also use both together - if a default value is provided in addition to a source field, the default value will be applied to any rows where the source field is empty or NULL.

関連する問題