Currently, using other fields defining their widgets to be those of Entity Reference fails with a denied access because the module makes sure the field for which the lookup is being done is an instance of EntityReference.

It should rather only check that the widget being used is declared as a widget for the EntityReference field (think duck typing).

Files: 
CommentFileSizeAuthor
#7 14156560-entityreference_autocomplete_access-7.patch3.36 KBfgm
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]
#5 14156560-entityreference_autocomplete_access.patch3.36 KBfgm
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]
#1 entityreference_autocomplete_access-1416560-2.patch3.42 KBfgm
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]

Comments

fgm’s picture

StatusFileSize
new3.42 KB
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]

Attached patch does just that (plus some phpdoc fixes).

fgm’s picture

Status:Active» Needs review

Of course, this needs to be reviewed.

amitaibu’s picture

hi fgm,
Can you explain your use case -- which module is going to use ER's widgets?

fgm’s picture

Hello,

This is for a (yet) unpublished "tree field" widget by DamZ I'm working with.

fgm’s picture

StatusFileSize
new3.36 KB
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]

Rerolled agains latest dev version.

fgm’s picture

Oh, and the module is now published: http://drupal.org/project/tree

fgm’s picture

StatusFileSize
new3.36 KB
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]

Added some typo fixes.

Damien Tournoud’s picture

I merged the typo fixes in 7.x-1.x.