hello,

it's been a while since i was actively developing my site, but i've gotten back to it and tried to administer my categories using the taxonomy_access module. when trying to add a new term to a vocabulary, i received the following set of errors:

user error: Column count doesn't match value count at row 1
query: INSERT INTO term_access VALUES (8, 1, 1, 0, 0, 1) in /usr/local/apache/vhosts/dev.simmonsmusic.com/htdocs/core/includes/database.mysql.inc on line 125.

user error: Column count doesn't match value count at row 1
query: INSERT INTO term_access VALUES (8, 2, 1, 0, 0, 1) in /usr/local/apache/vhosts/dev.simmonsmusic.com/htdocs/core/includes/database.mysql.inc on line 125.

user error: Column count doesn't match value count at row 1
query: INSERT INTO term_access VALUES (8, 3, 1, 0, 0, 1) in /usr/local/apache/vhosts/dev.simmonsmusic.com/htdocs/core/includes/database.mysql.inc on line 125.

user error: Column count doesn't match value count at row 1
query: INSERT INTO term_access VALUES (9, 1, 1, 0, 0, 1) in /usr/local/apache/vhosts/dev.simmonsmusic.com/htdocs/core/includes/database.mysql.inc on line 125.

user error: Column count doesn't match value count at row 1
query: INSERT INTO term_access VALUES (9, 2, 1, 0, 0, 1) in /usr/local/apache/vhosts/dev.simmonsmusic.com/htdocs/core/includes/database.mysql.inc on line 125.

user error: Column count doesn't match value count at row 1
query: INSERT INTO term_access VALUES (9, 3, 1, 0, 0, 1) in /usr/local/apache/vhosts/dev.simmonsmusic.com/htdocs/core/includes/database.mysql.inc on line 125.

---------------------

looking at the code i found this (in the function _taxonomy_access_update_db):

foreach($add_tids as $tid) {
foreach($all_rids as $rid) {
db_query('INSERT INTO term_access VALUES (%d, %d, 1, 0, 0, 1)', $tid, $rid);
}
}

// Add role permissions for all old taxonomy terms.
// nysus : Default permissions assume new role does not have access to content in any category
// pyromanfo : Drupal default is actually view only, as is the case with node_access
foreach($current_tids as $tid) {
foreach($add_rids as $rid) {
db_query('INSERT INTO term_access VALUES (%d, %d, 1, 0, 0, 1)', $tid, $rid);
}
}
// END: term_access table housekeeping

-------------------------------------------------

so it looks like either the term_access table doesn't have enough fields, or the code is trying to insert too many.

can you please take a look at this.

thanks,

srs

Comments

pyromanfo’s picture

You're trying to use the CVS code with the 4.5.0 database file. Drop your term_access and import the taxonomy_access.mysql from CVS.

stephenrs’s picture

i modified the taxonomy_access.module code by removing the last value from the values clause (the delete bit) on the inserts mentioned in my previous post, and it runs without error so far.

pyromanfo, can you please verify that this is the correct fix, and that i haven't broken anything else.

thanks,

ss

stephenrs’s picture

ahhh, just saw your message...wow fast response. i'll fix it as described.

thanks,

srs

keve’s picture

Status: Active » Closed (fixed)