基本的に、drupal 6 サイトの一部を drupal 7 ビルドに移動したいと考えていました。移行モジュールの使用。コメントと分類 (2 つの語彙、1 つは固定され、もう 1 つはカンマ区切り) を含む 155 のノードを移行しているときに、最後の 30 が失敗して次のエラーが表示されます。
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 不正な整数値: 行 1 の列 'tid' の ''
このクエリを使用して用語を移行しています:
$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');
これを 2 つの語彙に対して行い、名前、形式、重みだけをマッピングします。次に、ノードの移行中にこのクエリを使用しています。
$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');
次に、次のように各語彙の term_list をマッピングしています。
$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をマップしないとすべてのノードが作成されるため、これは用語が原因で発生していることを知っていますが、それはそれについてです。何か案は?