Using autocomplete on an entityreference field.

No problem running under Aquia + MSQL
Throws this error under PHP for IIS + MSSQL 2008 as soon as a type the first character..

Wondering if this is a known issue or a common gotcha before I post a detailed reproduction?

Thanks.

An AJAX HTTP error occurred.HTTP Result Code: 500

Debugging information follows.

Path: http://localhost/entityreference/autocomplete/single/field_track_artist/... StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting the nvarchar value 'James' to data type int.: SELECT revision.[vid] AS [vid], base.[uid] AS [uid], revision.[title] AS [title], revision.[log] AS [log], revision.[status] AS [status], revision.[comment] AS [comment], revision.[promote] AS [promote], revision.[sticky] AS [sticky], base.[nid] AS [nid], base.[type] AS [type], base.[language] AS [language], base.[created] AS [created], base.[changed] AS [changed], base.[tnid] AS [tnid], base.[translate] AS [translate], revision.[timestamp] AS [revision_timestamp], revision.[uid] AS [revision_uid]FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE ( ([base].[nid] IN (:db_condition_placeholder_0)) ); Array([:db_condition_placeholder_0] => James)

in DrupalDefaultEntityController->load() (line 196 of E:\wwwroot\localhost\includes\entity.inc).

Comments

damien tournoud’s picture

Status: Active » Closed (duplicate)
guideX’s picture

I was experiencing this problem with MS SQL 2008 R2 and IIS7 (not aquia), but the dev version on the modules page solved it for me.

jackfoust’s picture

My previous comment of "Dev did not help in my situation. MSSQL 2005, Drupal 7 and IIS6." was actually my own issue, sorry!

katannshaw’s picture

I have the same setup as you, and I'm receiving the same error. I've tried installing the dev version but that didn't fix the issue. This is an example of the error that I see:

PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the nvarchar value '%/moderation' to data type int.: SELECT revision.[vid] AS [vid], base.[uid] AS [uid], revision.[title] AS [title], revision.[log] AS [log], revision.[status] AS [status], revision.[comment] AS [comment], revision.[promote] AS [promote], revision.[sticky] AS [sticky], base.[nid] AS [nid], base.[type] AS [type], base.[language] AS [language], base.[created] AS [created], base.[changed] AS [changed], base.[tnid] AS [tnid], base.[translate] AS [translate], revision.[timestamp] AS [revision_timestamp], revision.[uid] AS [revision_uid] FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE ( ([base].[nid] IN (:db_condition_placeholder_0)) ); Array ( [:db_condition_placeholder_0] => %/moderation ) in DrupalDefaultEntityController->load() (line 196 of \mysite\drupal\includes\entity.inc).

This happens for me with several different Contrib modules.