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.

Files: 
CommentFileSizeAuthor
#13 entityreference-fixing_regression-1625188-13.patch965 bytesstefan.r
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es). View
#11 entityreference-fixing_regression-1625188-11.patch869 bytesliuba
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch entityreference-fixing_regression-1625188-11.patch. Unable to apply patch. See the log in the details link for more information. View
#4 entityreference-fixing_regresion-1625188-4.patch873 bytesmarcin.wosinek
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es). View
#1 1706664-2.am_.patch916 bytesjherencia
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es). View
#1 1706664-2.patch500 bytesjherencia
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es). View

Comments

jherencia’s picture

FileSize
500 bytes
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es). View
916 bytes
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es). View
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

FileSize
873 bytes
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es). View

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

FileSize
869 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch entityreference-fixing_regression-1625188-11.patch. Unable to apply patch. See the log in the details link for more information. View

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

Issue summary: View changes
FileSize
965 bytes
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es). View

reroll

stefan.r’s picture

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