Issue: when using the autocomplete, a sql error is generated in entityreference_autocomplete_autocomplete_callback(), resulting in a 500 error being returned to the user (and no entities to choose from).

Problem: the $label_column is not found, causing $query->propertyCondition($label_column, '%' . $last_label . '%', 'LIKE'); to fail.

Reason: In entityreference_autocomplete_resolve_entity_label_column() the first line is entity_get_info($entity_type);, which should be $entity_info = entity_get_info($entity_type);. This will allow the following if statement to correctly find the label column. The function entity_get_info() returns a value, it does not operate on its parameters.

I was using this module with commerce_products, so in my case the label column is "title".

CommentFileSizeAuthor
entity_label_column-0.patch654 byteskscheirer

Comments

ndrosev’s picture

Yes ,that patch works fine. I made the same patch yesterday and I have an idea to post it today ,but you were faster than me. Thanks and confirm that it works.

ndrosev’s picture

Status: Needs review » Reviewed & tested by the community

Review passed. Works

  • slv_ committed ae3e9b2 on 7.x-1.x authored by kscheirer
    Issue #2358331 by kscheirer and ndrosev: Fixed Autocomplete doesn't...
slv_’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Right, that's a bugfix I introduced with the refactoring done on the last release. Not sure how I missed that one.

committed and pushed to 7.x-1.x-dev

Thanks!