I like how simple it is to use autocomplete to reference a username. Any thoughts on how to reference the realname or profile2 fields.

Use case: Enter the member name you'd like to nominate for xyz.

In this use case the user filling out the form would be think of a full name not the username.

Comments

PascalAnimateur’s picture

Here's a patch that works in my case.

Great module !

PascalAnimateur’s picture

PascalAnimateur’s picture

PascalAnimateur’s picture

PascalAnimateur’s picture

Status: Active » Needs review
StatusFileSize
new3.4 KB

Oops patch name now matches comment #

PascalAnimateur’s picture

Version: 7.x-1.x-dev » 7.x-1.8
StatusFileSize
new4.34 KB

Better patch that handles autocomplete validation correctly.

sumitmadan’s picture

Status: Needs review » Needs work

HI @PascalAnimateur,

Thanks for your efforts. But I believe that it is not the way we should make it. I was thinking of making this same as reference module does, I mean integrate views result as its values, if it is possible to achieve. Otherwise we can leave it as it is for now. A user can alter the form element the way he wants to display the value.

PascalAnimateur’s picture

Indeed, that would be the proper way to achieve this... this is similar to what webform_views_select does.
I wrote this patch because I needed it for a project in which realname is always used.

vistree’s picture

I like the patch from PascalAnimatuer. Why not include it. I think this is an often needed function. If someone finds the time to integrate a views solution this might can be removed.
I would be happy if the patch from #6 could be commited. Tested and works great!

sumitmadan’s picture

My concern is because realname is not a frequently used module. I believe one using realname + webform reference on the same site can hook_form_alter.

For view integration please test #2656246: Support to create option list from a view issue otherwise I will test whenever I get time.

sumitmadan’s picture

Status: Needs work » Closed (works as designed)

I am closing this issue.

PascalAnimateur’s picture

Updated my patch from #6 to work with 7.x-1.9.

sumitmadan’s picture

Hi PascalAnimateur,

Please use the view if you want to display the real name value. I believe there is no need to make it complicated using real name integration. If you face any issue in view integration then please feel free to open a new issue.