Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
taxonomy.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2008 at 23:50 UTC
Updated:
1 Feb 2009 at 23:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
catchThis is a bug. I'll roll the patch if no-one else does.
Comment #2
jody lynnThere are many places where the table names will have to be changed in core (and it will be a little more manual than just a find and replace), so let's agree on the new table names first of all.
I propose:
term_data -> taxonomy_term
term_hierarchy -> taxonomy_hierarchy
term_node -> taxonomy_node
term_relation -> taxonomy_relation
term_synonym -> taxonomy_synonym
vocabulary -> taxonomy_vocabulary
vocabulary_node_types -> taxonomy_vocabulary_types
The attached patch is an update function only just as a start.
Comment #3
catchI'd almost be tempted to go the whole hog and make it taxonomy_term_data taxonomy_term_hierarchy etc., but those are annoyingly long table names...
Comment #4
Crell commentedRefiling this over to the taxonomy component as this really has nothing to do with the database API itself. I approve of nicer table names, however. :-)
Comment #5
jody lynnNew patch prepends all taxonomy tables with taxonomy_ as per comment 3.
This patch replaces all instances of the table names and has an update function.
There already was an update in taxonomy.install for D7 to change vocabulary_node_types to vocabulary_node_type, so I changed that one to taxonomy_vocabulary_node_type.
Comment #6
dami commentedPatch applies and looks good on fresh install.
Shall a upgrade path provided in system.install?
Comment #7
dries commentedI think this is a good move -- just to keep the table namespace consistent and clear. :)
Comment #8
catchThe upgrade path is already in taxonomy.install so that's covered, and that's the right place for it. Everything else looks fine to me on a quick visual review, and the bot is happy. Do we need to test the d6 update path manually? Don't have time to do that now but will try to have a proper look later if no-one beats me to it.
Comment #9
jody lynnI tested the D6 update manually and then ran applicable simpletests (blogapi, forum, node, taxonomy) on the updated site. Everything was fine.
Comment #10
dries commentedCommitted to CVS HEAD. Please update the upgrade instructions in the handbook, and mark 'fixed' once complete. Thanks!
Comment #11
dries commentedMmm, I rolled back this patch. I think there might still be something wrong.
Comment #12
catchDries, I just ran all relevant tests (about to start a complete test run edit: that passed too), and it seemed fine. Anything specific go wrong?
Comment #13
catchBack to CNR for the test bot.
Comment #14
dries commentedGoing to ?q=admin/content/taxonomy, for example, results in a database error:
PDOException: SELECT v.*, n.type FROM {taxonomy_vocabulary} v LEFT JOIN {taxonomy_vocabulary_node_type} n ON v.vid = n.vid ORDER BY v.weight, v.name - Array ( ) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_cvs.taxonomy_vocabulary' doesn't exist in taxonomy_get_vocabularies() (line 463 of /Users/dries/Sites/drupal-cvs/modules/taxonomy/taxonomy.module).
Inserting a vocabulary also gives me an error:
PDOException: INSERT INTO {taxonomy_vocabulary} (name, description, help, relations, hierarchy, multiple, required, tags, module, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9) - Array ( [:db_insert_placeholder_0] => test [:db_insert_placeholder_1] => test [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => taxonomy [:db_insert_placeholder_9] => 0 ) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_cvs.taxonomy_vocabulary' doesn't exist in drupal_write_record() (line 3806 of /Users/dries/Sites/drupal-cvs/includes/common.inc).
I ran update.php. I didn't do a clean install so it looks like the upgrade path is broken?
Comment #15
damien tournoud commented@Dries: we don't do 7 -> 7 upgrades for now. The patch just modified an existing upgrade function, so the behavior you are seeing is expected.
Comment #16
jody lynnI think your problem is likely that the taxonomy update function is a revision of the recently committed update to switch vocabulary_node_types to singular. If updating from HEAD you have to select the update manually. Should we increment the update function number to avoid this?
Comment #17
damien tournoud commented@Jody Lynn: we don't support 7 to 7 updates. Changes like this are bound to break existing installations.
Comment #18
dries commentedAlright, it works with a clean install! Committed to CVS HEAD. Thanks.
Comment #19
jody lynnMarking CNW until I finish the documentation (as per comment 10)
Comment #20
jody lynnModule update documentation added: http://drupal.org/node/224333#taxonomy_tables