How to use autocomplete field excercise
I am stuck on the exercise how to use Autocomplete field under How to use Term and Node Reference Fields in Build Your First Drupal 7 site.
Here is the problem: When I type in the city in the Location field and hit save I get this error message:
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] => Anchorage ) in DrupalDefaultEntityController->load() (line 193 of C:\Users\Corey\Sites\devdesktop\drupal-7.36\includes\entity.inc).
The website encountered an unexpected error. Please try again later.
Does anyone have any idea on how to solve this issue? I would like to get this straight before I move on. Any help would be greatly appreciated.
From doing a quick search, it looks like One person was able to fix this in a different context by altering user permissions:
"Had the same issue... had to allow "Administer vocabularies and terms" for each role that needed to add terms to the taxonomy, not just admin."
Your issue is a bit different, and I haven't been able to track down a solution to it, but playing with permissions could be one way to test things out. For example, check if you still get the error as an admin, or if it just happens on less permissive accounts.
This also could be an issue with a particular module you're using, and may be fixed in later versions. If that's the case, as a workaround in the meantime, you might be able to switch to using a select list instead of an autocomplete.