The documentation on Converting 6.x modules to 7.x states that the drupal6 table term_node was renamed to taxonomy_term_node. However, no such table exists in drupal7, and it's not immediately clear what the correct replacement table is.
The replacement table for term_node appears to be taxonomy_index. However, taxonomy_index does not contain the vid field previously found in term_node (where I believe vid in this context is the node revision id, rather than the vocabulary id). I'm guessing that in cases where the revision id is relevant, you now need to check the appropriate field table (e.g., field_data_field_tags). However, I'm not sure, which is why I'm posting this as an issue instead of trying to update the documentation myself.
Specific sections of the documentation that need to updated are:
- Taxonomy db table names have changed to begin with 'taxonomy_'
- db_rewrite_sql() replaced with hook_query_alter(). This section uses taxonomy_term_node in its example query, but I'm not sure whether it is really an appropriate example given how extensively the query has changed in drupal7 -- wouldn't it be easier to see how the query API has changed if the tables aren't also being completely restructured?
. This section documents the new table names.
Comments
Comment #1
jhodgdonThanks for finding this. I'm not sure what the right answer is... Changing tag (we use Needs Update Documentation for updates needed to the update documentation).
Comment #2
droplet commentedtaxonomy.install
"db_rewrite_sql() replaced with hook_query_alter()"
I would suggest don't change TABLE_NAME for examples. It's an example to show the new way only. use same name is more clear. Or we take another new examples without table_name changes
Comment #3
jhodgdonActually, the table name is important for db_rewrite_sql, in my opinion. You have to know what tables you are operating on. But probably the example should use the node table.
Comment #4
jhodgdonOK. I have put a new example in the db_rewrite_sql section, and added a note to the taxonomy table name change section. Should be clearer.
http://drupal.org/update/modules/6/7#taxonomy_tables
http://drupal.org/update/modules/6/7#db_rewrite_sql