We are working in a patch for inline_entity_form #1526084: Abilty to add existing entities that uses entityreference's automplete behavior.

In node/entity creation form fails because in entityreference_autocomplete_callback there is a bug on $entity_id comprobation.

The patch I append fixes the problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jherencia’s picture

FileSize
500 bytes
916 bytes
marcin.wosinek’s picture

Status: Needs review » Postponed (maintainer needs more info)

Could you post exact steps to reproduce this error? I've tried using autocomplete within inline_entity_form and it worked without patch.

jherencia’s picture

Status: Postponed (maintainer needs more info) » Needs review

See the code and you'll find that in entityreference_autocomplete_callback $entity_id is set to '', not NULL as the comprobation expects. So even if in your installation of inline_entity_form works, it's a bug that probably will break something else.

Changing to needs review.

marcin.wosinek’s picture

I've investigated code, and issue #1625188: Autocomplete widget failed to return any nodes for reference introduced 'NULL' as argument for non entity_id. So it looks like default value fell out of sync. Here's patch.

marcin.wosinek’s picture

@jherencia could you check #4?

jherencia’s picture

Status: Needs review » Reviewed & tested by the community

Yes, it works too :).

bojanz’s picture

Note that Inline Entity Form doesn't need this patch since we went with using our own autocomplete callback after all.

jherencia’s picture

Status: Reviewed & tested by the community » Fixed
rocketeerbkw’s picture

Status: Fixed » Reviewed & tested by the community

#4 makes sense to me and should still be committed to entityreference even if inline_entity_form isn't broken anymore.

jherencia’s picture

@rocketeerkbw

You are right, so RTBC.

liuba’s picture

Here is the patch for the latest recommended version - 7.x-1.0

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: entityreference-fixing_regression-1625188-11.patch, failed testing.

stefan.r’s picture

reroll

stefan.r’s picture

Status: Needs work » Reviewed & tested by the community
DamienMcKenna’s picture

minorOffense’s picture

Status: Reviewed & tested by the community » Closed (works as designed)

I'm pretty sure this isn't relevant anymore. Plus the patch technically adds the word "NULL" and not the value NULL