diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-04 14:51:16 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-04 14:51:16 +0000 |
commit | a1cbd755458534fb2baf161307ca964ff17f22ca (patch) | |
tree | 812f777498b0966e413e91f76200dfd53d07081b /modules/taxonomy | |
parent | 522c052fadabe6685e7292b7001966c2eedf5975 (diff) | |
download | brdo-a1cbd755458534fb2baf161307ca964ff17f22ca.tar.gz brdo-a1cbd755458534fb2baf161307ca964ff17f22ca.tar.bz2 |
#930708 by catch, dww: Fixed taxonomy_update_7005() can go on an infinite search.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r-- | modules/taxonomy/taxonomy.install | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install index bd8110961..95c68fdee 100644 --- a/modules/taxonomy/taxonomy.install +++ b/modules/taxonomy/taxonomy.install @@ -566,8 +566,11 @@ function taxonomy_update_7005(&$sandbox) { $sandbox['last'] = 0; $sandbox['count'] = 0; - $query = db_select('taxonomy_term_node', 't'); - $sandbox['total'] = $query->countQuery()->execute()->fetchField(); + // Run the same joins as the query that is used later to retrieve the + // term_node data, this ensures that bad records in that table - for + // tids which aren't in taxonomy_term_data or nids which aren't in {node} + // are not included in the count. + $sandbox['total'] = db_query('SELECT COUNT(*) FROM {taxonomy_term_data} td INNER JOIN {taxonomy_term_node} tn ON td.tid = tn.tid INNER JOIN {node} n ON tn.nid = n.nid LEFT JOIN {node} n2 ON tn.vid = n2.vid')->fetchField(); // Use an inline version of Drupal 6 taxonomy_get_vocabularies() here since // we can no longer rely on $vocabulary->nodes from the API function. |