12

please look at these screenshots.
When I use entity reference in a views and autocomplete widget, It worked well.
but when I edit node, it chenged referenced field value as a screenshot 2
Other widgets worked perfect like list or select box (didn't change its value) only has a problem with autocomplete widget.
It automatically changes its value to original(referenced) title I think , but I'm using profile2 I can't change its title.
How can I use autocomplete widget without this problem?
or can I change profile2's title what I want?

Files: 
CommentFileSizeAuthor
#5 entityreference-1896210-5.patch3.94 KBmarcoscano
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]
#2 entityreference-1896210-2.patch3.84 KBkleinmp
PASSED: [[SimpleTest]]: [MySQL] 119 pass(es).
[ View ]
#1 entityreference-1896210-1.patch3.79 KBJody Lynn
PASSED: [[SimpleTest]]: [MySQL] 119 pass(es).
[ View ]
Screenshot_2.png3.23 KBNicolo2
Screenshot_1.png4.77 KBNicolo2

Comments

Status:Active» Needs review
StatusFileSize
new3.79 KB
PASSED: [[SimpleTest]]: [MySQL] 119 pass(es).
[ View ]

The default value of the autocomplete fields is being set to just the label of the entity (ignoring the views settings).

This patch adds functionality to the views plugin to get the output from the view not just the entity label.

StatusFileSize
new3.84 KB
PASSED: [[SimpleTest]]: [MySQL] 119 pass(es).
[ View ]

I tested this out and it solves the problem of this issue.

I made a couple of minor tweaks to check if the entity_id is empty before initializing the view and using the php end of line character.

Patch in #2 works for me.

News? Should this be committed?

Issue summary:View changes
Status:Needs review» Reviewed & tested by the community
StatusFileSize
new3.94 KB
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

Same problem here

Patch in #2 doesn't apply cleanly anymore. Re-created a new one with the same code, patch attached.

Marking as RTBC once this solves the problem for me also

Patch #5 works for me

Title:Problem with autocomplete widget and Views When filtering autocomplete by a view #default_value always be the entity title instead of the custom view result (e.g. a field on the entity)

RTBC from me as well.