Here is an old solved issue about exposing the real name filter in views - - http://drupal.org/node/436564. I'm having the same issue for the drupal 7 version and I'm wondering wha the filter code should be? I need to be able to expose a real name filter in a view. I could use the actual profile field, but the problem with that is it won't find normal user names if they didn't fill that field out. In my particular case it's not required.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | realname.views_.inc_.patch | 439 bytes | lemuelsantos |
| #3 | views-1170230-3.patch | 1.43 KB | joelstein |
Comments
Comment #1
geerlingguy commentedI'm seconding this request - #436564: Support Views FILTER seems to have been committed to 6.x-1.3, but I don't see a filter in views on my D7 site using Views 7.x-3.x-dev.
Comment #2
dave reidThe 7.x-1.x version was a complete rewrite. Feel free to write a patch to re-add the Views integration.
Comment #3
joelstein commentedHere's an initial attempt at Views support. It only adds the Realname field so you can include it in your Views. It does not add support for overriding existing Views.
Comment #4
geerlingguy commentedI've tested the patch above, and it works awesome for what I need:
I would love to see even just this patch committed, so the basic views functionality is present. We could do extra stuff later...
Comment #5
dave reidCommitted #3 to Git: http://drupalcode.org/project/realname.git/commit/b530d57 - we can have follow-ups for this as separate issues.
Comment #6
lemuelsantos commentedIn my personal opinion the patch that was committed needs to be changed since the MAIN GOAL of this module is to show the REALNAME over the USERNAME take a look on the following actual code:
Needs to be changed to this:
On the "handler" line change from "views_handler_field_user" to this "views_handler_field_user_name"
I think it would make more sense...
Thanks.
Comment #7
lemuelsantos commentedAttaching the patch file for the above comment.
Comment #8
Anandkumar commentedI can include the Realname field into the Fields and Filters section of Views. So far so good; but I want to expose this field as an auto-complete field. Like the one in Privatemsg module. Is there plan for this support?
Comment #9
Anandkumar commentedNever mind, I figured out how to do this, and it is pretty simple. I just added #autocomplete_path attribute to the filter element from my module file:
Comment #10
WorldFallz commentedSlight correction to the code from #9 (there's no need to return $form):
Comment #11
WorldFallz commentedThe code in #10 is correct, but it actually breaks the filter (it no longer works), because the sql it generates is searching for realname LIKE the username, which will fail. Still working on finding an acceptable workaround.