Using the autocomplete widget, I am unable to return any nodes for reference. It seems that it got cutoff while retrieving the list. Looking inside my php-fpm error log and also inside my webserver log reveals no error. Any ideas where I can pinpoint the problem is ? Could it be my nginx configurations ? Ajax ? Any ideas are much appreciated.

Comments

moochiku’s picture

Status: Active » Fixed

Found the answer in the issue que somewhere (I am unable to find it now ... I think its under 'special consideration for nginx').

As suspected .. its the webserver config, as in my case, nginx merging the double slashes. In order to remedy this problem add the following into your nginx.config under http section:

merge_slashes off;

thommyboy’s picture

Status: Fixed » Active

would like to re-open this issue. i've got the exact same problem. dropdown working, autocomplete does not fetch any nodes.
i'm not using nginx but lighttpd. any idea how to narrow that problem?

jody lynn’s picture

Status: Active » Needs review
StatusFileSize
new971 bytes

Same issue, using Apache.

This patch forces a 0 into the path to prevent the double slash scenario.

damien tournoud’s picture

Here is an alternative suggestion. We use the term "NULL" inside the URL, as zero is actually a valid entity ID for some entities (the most important of it being users). Also, we should probably check that the user has access to the target entity before returning results.

jody lynn’s picture

Status: Needs review » Reviewed & tested by the community

Damien's patch looks good.

tim.plunkett’s picture

In addition to looking good, I tested it and it definitely fixes the problem.

Timusan’s picture

StatusFileSize
new1.45 KB

I also applied this patch to the 7.x-1.x-dev branch and the autocomplete ajax returns a server 500 error.
*Beware* I'm running on PostgreSQL...and the error comes from PDO:

Statustekst: Internal Server Error
Response: PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: ""
LINE 5: WHERE  (base.nid IN  ('')).

Apparently the NULL was not placed behind the URL, attached patch fixes this issue.
It now works fine for me :)

thommyboy’s picture

works fine for me with patch #7
the other patch did not work- still got a // in my url the log said...

mattlc’s picture

Worked fine for me too. Tks!

damien tournoud’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

marcin.wosinek’s picture

This issue introduced little regression - here is discussion & patches #1706664: Autocomplete fails with inline_entity_form

yyjamal’s picture

Issue summary: View changes

Hi
I am new to Drupal. How can I apply the patch?
When I type in a field that has autocomplete, this errors is popping up.
It seems the autocomplete is sending the the right data, but the jQuery is not displaying it properly. I am not sure.
Here is what I get:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: https://12345.com/index.php?q=entityreference/autocomplete/single/field_...
StatusText: Internal Server Error
ResponseText: {"ELEE 2200U - Electrical Engineering Fundamentals (302)":"\u003Cdiv class=\u0022reference-autocomplete\u0022\u003EELEE 2200U - Electrical Engineering Fundamentals\u003C\/div\u003E"}