Whenever I enter a tag value for an existing image I get the following error:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 2: SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.name LIKE :db_condition_placeholder_0 ESCAPE '\\') AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => Products ) in DrupalDefaultEntityController->load() (line 196 of C:\xampp\htdocs\drupal-7\includes\entity.inc).
Comments
Comment #1
sniffypup commentedFurther investigation (by comparing similar steps on a cleaner D7 installation) shows the issue may be related to the addition of the tag field.
On my system, when adding the field to any content type the vocabulary available is fixed as "Gallery Collection" (I have Media version 7.x-1.0-beta5 and Media Gallery version 7.x-1.0-beta6 installed). The same modules (and versions) are on the cleaner system but the problem doesn't occur there!
Comment #2
marcingy commentedCan't reproduce on a core install on 7.7
Comment #3
leewoodman commentedI get the same error
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 2: SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.name LIKE :db_condition_placeholder_0 ESCAPE '\\') AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => C3 ) in DrupalDefaultEntityController->load() (line 196 of /home/afolder/public_html/mysite/includes/entity.inc).
The website encountered an unexpected error. Please try again later.
L
Comment #4
leewoodman commentedOK for me...i had deleted the taxonomy vocabulary and still had not updated the content type field to reflect the new taxonomy vocab name
Works fine now
Lee
Comment #5
glennamaddy commentededited content type to refer to vocab, if you delete your vocab you'll have to repoint the content types to the new vocab
Comment #6
rdeboerHaving this the moment I save a basic, core Article tag in 7.10!
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 2: SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.name LIKE :db_condition_placeholder_0 ESCAPE '\\') AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => whatever) in DrupalDefaultEntityController->load() (line 196 of .../includes/entity.inc).
Comment #7
Everett Zufelt commented@RdeBoer
Do you have any contributed modules installed? Can you please provide steps to reproduce?
Comment #8
Everett Zufelt commentedComment #9
rdeboerAt this stage I can only say that it was a Drupal 7.? install to begin with that was progressively upgraded to 7.10.
The optional "tags" on the Article type were never entered until today. The moment an existing Article is saved or previewed with a tag entered, the error occurs.
Very strange...
Comment #10
Everett Zufelt commentedComment #11
rdeboerAfter more research I found that in my case this error happend when the "field_tags" existed on the Article content type and appeared in the Field List at .../admin/reports/fields, but the underlying Taxonomy was somehow missing from the .../admin/structure/taxonomy page.
When I recreated the "Tags" taxonomy (machine name "tags") it worked!
Rik
Comment #12
mgiffordI just got this with the latest version of D7:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'FROM taxonomy_vocabulary base ORDER BY base.weight ASC, base.name ASC' at line 1: SELECT FROM {taxonomy_vocabulary} base ORDER BY base.weight ASC, base.name ASC; Array ( ) in DrupalDefaultEntityController->load() (line 196 of /DRUPAL7/includes/entity.inc).
There should be a better way to track this down though... I do think it's a matter of inserting the taxonomy, probably through phpMyAdmin.
Comment #13
utilum commentedPDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 2: SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.name LIKE :db_condition_placeholder_0 ESCAPE '\\') AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => tx ) in DrupalDefaultEntityController->load() (line 196 of /includes/entity.inc).
To reproduce :
Install drupal minimal profile.
Enable taxonomy, field_ui.
Create vocabulary "Tags".
Create content type "Article".
Add field_tags of type Term reference to Article.
Create Article content type with some value in the tags field.
Click save.
Comment #14
interlated commentedYes basic site. Using default 'Tags' taxonomy entry.
I added a new taxonomy and specified this in the content types editor and it works fine.
Therefore, using the default Tags taxonomy doesn't work. The content type has 'Tags defined' as the vocabulary. Root cause is that the taxonomy code doesn't find this in some way?
It looks like this: AND (base.vid IN ()) is the error. Scrolling through the above this syntax all looks incorrect and I have it too:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 2: SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.name LIKE :db_condition_placeholder_0 ESCAPE '\\') AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => Republicanism ) in DrupalDefaultEntityController->load() (line 196 of /srv/bloggerme.com.au/web/includes/entity.inc).
John
Comment #15
duckydan commentedYet another drupal.org page that just saved me. I had spent two hours troubleshooting a relatively simple View. Turned out a og_vocab field I had experiment with was left in the field_config_instance but not in field_config. It was causing silent failures when editing a View, and error messages when previewing it.
Comment #16
pabloirun commentedHi,
In my case, deleting and creating again the field_tags in the article content type solved the problem.