I'm executing a migration of nodes and users (using the Migrate Module) and I'm seeing the following error:

WD node: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_db.term_node' doesn't exist: SELECT COUNT(n.nid) AS term_count
FROM 
{term_node} tn
INNER JOIN {node} n ON n.nid = tn.nid AND n.status = 1
WHERE  (tid = :db_condition_placeholder_0) ; Array
(
    [:db_condition_placeholder_0] => 5
)
 in _taxonomy_menu_term_count() (line 157 of ~/public_html/sites/all/modules/taxonomy_menu/taxonomy_menu.database.inc).
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_db.term_node' doesn't exist: SELECT COUNT(n.nid) AS term_count                                                                                    [error]
FROM 
{term_node} tn
INNER JOIN {node} n ON n.nid = tn.nid AND n.status = 1
WHERE  (tid = :db_condition_placeholder_0) ; Array
(
    [:db_condition_placeholder_0] => 5
)
 (~public_html/sites/all/modules/taxonomy_menu/taxonomy_menu.database.inc:157)

Comments

zabelc’s picture

No idea if this is what's intended by the function but this appears to make keep my migration from failing:

function _taxonomy_menu_term_count($tid) {
  $select = db_select('taxonomy_index', 'tn');
  $select->addExpression('COUNT(n.nid)', 'term_count');
  $select->condition('tid', $tid);
  $select->join('node', 'n', 'n.nid = tn.nid AND n.status = 1');
  $result = $select->execute();
  return $result->fetchField();
}
dstol’s picture

Status: Fixed » Closed (fixed)

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