I installed the 5.x build into my copy of Drupal 5.1. It appears to work fine, BUT when I change the permission settings on any item I get this:

user warning: You have an error in your SQL syntax near ',,0,0)' at line 1 query: INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (1,21,,,,0,0) in /home/httpd/vhosts/thepeatgroup.com/httpdocs/vli/includes/database.mysql.inc on line 172.
user warning: You have an error in your SQL syntax near ',,0,0)' at line 1 query: INSERT INTO term_access (tid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (3,21,,,,0,0) in /home/httpd/vhosts/thepeatgroup.com/httpdocs/vli/includes/database.mysql.inc on line 172.
user warning: You have an error in your SQL syntax near ',,0,0)' at line 1 query: INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (2,21,,,,0,0) in /home/httpd/vhosts/thepeatgroup.com/httpdocs/vli/includes/database.mysql.inc on line 172.
user warning: You have an error in your SQL syntax near ',,0,0)' at line 1 query: INSERT INTO term_access (tid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (4,21,,,,0,0) in /home/httpd/vhosts/thepeatgroup.com/httpdocs/vli/includes/database.mysql.inc on line 172.
user warning: You have an error in your SQL syntax near ',,0,0)' at line 1 query: INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (3,21,,,,0,0) in /home/httpd/vhosts/thepeatgroup.com/httpdocs/vli/includes/database.mysql.inc on line 172.

any ideas?

Files: 

Comments

chazoopa’s picture

I get the same error...... Watching this post.

Drupal 5.1
5.x build of taxonomy_access
MySQL database 3.23.58
PHP 4.3.11

keve’s picture

Status:Active» Fixed

Commited to both HEAD and 5.x

brianpeat’s picture

so for a newbie, what exactly does "committed" mean?

keve’s picture

I "uploaded" the corrected version to DRUPAL-5.x. So that you can download the new tarball from the TAC project page.

chazoopa’s picture

Status:Fixed» Active

I have just downloaded & installed the fix, but still get the same error.

user warning: You have an error in your SQL syntax near ',,0,0)' at line 1 query: INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (4,2,,,,0,0) in /xxxx/xxxx/xxxx/includes/database.mysql.inc on line 172.

Any further ideas?

brianpeat’s picture

did you use the update.php page and update the module? I did (not sure if that helped or not, but I chose the highest number) and I no longer get errors.

keve’s picture

Chazoopa: Check if the version number inside taxonomy_access_admin.inc is v 1.9.2.1. That is the latest version for Drupal 5.x

wmostrey’s picture

I had this error too and can confirm that all is ok with the new version. Thanks!

chazoopa’s picture

Keve, I have v 1.9.2.1. Could I have messed up the db update? Should I choose a different update 1, 2, 3 or 4?

FYI, when I did the update, I removed all exiting files before I put on the new files you released.

keve’s picture

No update needed: #1-4 makes database updates, an it has not changed since 4,7.x

I will recheck it, but on my system it works.

Can you check on permission page:
- Does any radio form is checked (I,A,D)? Or are they empty?

If you fill out every radio form, then at submission does this error occur? After this, when you reopen same page, does any radio form is checked?

Andreas Wolf’s picture

The error is gone for me with taxonomy_access_admin.inc 1.9.2.1.
The main problem was that this version is NOT part of the tarball mentioned under #4 (taxonomy_access-5.x-1.x-dev.tar.gz).
I had to download this file from CVS.

wmostrey’s picture

Not sure I agree with you Andreas. I downloaded taxonomy_access-5.x-1.x-dev.tar.gz and that fixed this issue for me.

Jürgen Depicker’s picture

I'm getting the same errors, using version DRUPAL-4-7 from cvs (eclipse dev environment).
I believe I'm not supposed to use the HEAD version, when my Drupal is 4-7-6 , or can I? Please help me out.

* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,0,0)' at line 1 query: taxonomy_access_defaults_update INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (9,2,,,,0,0) in /var/www/includes/database.mysql.inc on line 121.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,0,0)' at line 1 query: taxonomy_access_defaults_update INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (8,2, , , ,0,0) in /var/www/includes/database.mysql.inc on line 121.

Jürgen Depicker’s picture

I've just merged the four lines with the '? :' construct, to provide for '0' when not set in the INSERT statement, and all works now. But my question remains: my site uses drupal-4-7 versions from CVS, so how could I have updated properly this module to make it work? Is using HEAD allowed or will it break my site?

keve’s picture

Jürgen, can you provide a patch?

You can use cvs (in the TAC directory):
cvs up -r DRUPAL-4-7

HEAD is intended for 5.x at the moment or later for 6.x.

mondo_bongo’s picture

I'm having the same issues, and I am running 4.7.6

I have a test site on the same server that is not having the problem. I test the modules on the test site, then copy them to the production site. The production site was just built last week; the test site is about a month old.

The errors on the production site occur as soon as I click "submit". The changes appear to take.

I have the same problem with the new CVS, too.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,0,0)' at line 1 query: INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (1,2,,,,0,0) in /home/user/www/domain/includes/database.mysql.inc on line 121.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,0,0)' at line 1 query: INSERT INTO term_access_defaults (vid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (4,2,,,,0,0) in /home/user/www/domain/includes/database.mysql.inc on line 121.

Many thanks.

keve’s picture

Version:5.x-1.x-dev» 4.7.x-1.x-dev

I change version for this issue, since i consider this fixed for 5.x.

Jürgen Depicker’s picture

Re: keve
Sorry, keve, I didn't really find out yet how to do that using Eclipse. I'll find out this week I hope ;-) and post a patch here.

zonker’s picture

Please see attached patch for DRUPAL-4-7.

-nick

keve’s picture

Thanks zonker for the patch. I commited it to 4.7.x. :)

(Sorry, i could not fix this earlier, thought i also commited this change to both 5.x and 4.7.x)

keve’s picture

Status:Active» Fixed

Thanks zonker for the patch. I commited it to 4.7.x. :)

(Sorry, i could not fix this earlier, thought i also commited this change to both 5.x and 4.7.x)

Anonymous’s picture

Status:Fixed» Closed (fixed)
juanval’s picture

Status:Closed (fixed)» Active

I still having problems with inserts when saving role permissions. I use PHP 5.2.1 and MySQL 5.0.26. Seems that inserts with the form "INSERT INTO (field1, field2, field3, field4, field5) VALUES (value1,,,,value5)" are not supported on mysql5, returning errors like this:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,)' at line 1 query: INSERT INTO term_access (tid,rid,grant_view,grant_update,grant_delete,grant_create,grant_list) VALUES (54,3,,,,,) in

After reading INSERT syntax on mysql documentation site, seems that the correct SQL is: "INSERT INTO (field1, field2, field3, field4, field5) VALUES (value1,DEFAULT,DEFAULT,DEFAULT,value5)"

Any suggestions/fixes please? We have down by this problem a hosting server with more than 100 drupal sites after an update to PHP 5.2 and MySQL 5.0.26.

juanval’s picture

Sorry, in the previous comment I forgot to say that we use drupal 4.7.4 and latest version o taxonomy_access. Also, we tried to migrate to 5.1 and problem persists.

juanval’s picture

Status:Active» Fixed

Solved.

By mistake we have activated suhosin hardended php module. Once deactivated, the problem disappeared. Seems, that suhosin modifies in some manner form variables used by taxonomy access.

Anonymous’s picture

Status:Fixed» Closed (fixed)