In Drupal 7.39 some changes were made to autocomplete functionality. You need an additional process function for the autocomplete to work. See https://www.drupal.org/drupal-7.39-release-notes for details.

As a result of this change, the autocomplete of entityreference_autocomplete is currently broken in Drupal 7.39.

Comments

FeyP created an issue. See original summary.

feyp’s picture

Attached is a patch against 7.x-1.x-dev

feyp’s picture

Status: Active » Needs review
mbrc’s picture

Status: Needs review » Reviewed & tested by the community

FeyP's patch fixes the issue for me.
Thank you!

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new809 bytes

The first part of the patch looks good, but I think the second part is unnecessary. The value callback doesn't have anything to do with the Ajax system, and either way I don't think this module would have any reason to set the verification header on its own?

Here's a version that just includes the first part. Works fine for me.

I will add this to the Drupal 7.39 release notes.

feyp’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

David and mbrc, thanks for the review and for pointing out the useless second part. Seems that I confused the ajax callback mentioned in the release notes and the value callback... I can confirm, that the revised version of the patch works fine, so setting this back as RTBC.

galooph’s picture

Patch from #5 works for me. - Thanks!

drubb’s picture

Here's a quick one if you don't want to patch the module: just implement hook_element_info_alter() in a custom module!

function mymodule_element_info_alter(&$type) {
  $type['entityreference']['#process'] = array(
    'entityreference_autocomplete_process_entityreference',
    'form_process_autocomplete',
    'ajax_process_form'
  );
}
Leeteq’s picture

Priority: Normal » Major
eric_a’s picture

I think #5 is going to cause a fatal error on 7.38 so it seems that either a dependency on >=7.39 or a function_exists() is needed.

slv_’s picture

Thanks everybody for the ideas and suggested patches. As it's been pointed out, there's a need for the dependency in the .info file, or the function_exists check.

I've solved this with merging the 2 patches provided in #2561431: Elements with autocomplete require #autocomplete_input since Drupal core 7.39., which is a duplicate of this (it was created after this one), but used it because the function_exists check was provided already in one of the patches there.

So, fixed now in dev, and rolling out a new release now. Thanks all \o/.

slv_’s picture

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