How to use autocomplete field excercise

1 reply [Last post]
avs302003
Offline
Last seen: 3 years 43 weeks ago
Joined: 2015-04-27

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.

Chris Shattuck
Offline
Last seen: 3 days 10 hours ago
Joined: 2009-08-16
From doing a quick search, it

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.

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:


Loading...
Contact us

Below are the supported keyboard shortcuts for our video player.

space
Start / stop video
shift
Go to next video
shift
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
1...9
Jump to a percentage (2 is 20%, for example)
f
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
$29
1 month
$156
6 months
10% off
$276
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
user
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.