siteslab / cwcon2014

drupal files for #cwcon 2014
GNU General Public License v2.0
0 stars 0 forks source link

Make first name last name formatter work for more fields #110

Closed chrisarusso closed 10 years ago

chrisarusso commented 10 years ago

Look into making it more robust for other scenarios as well.

knowledges33ker commented 10 years ago

Chris, I'm trying to follow along like we talked about. I see that on line 15 of your module code, 'field types' => array('entityreference', 'node_reference', 'user_reference'), it specifies what field types the formatter is activated for. Could we add 'user' to that since it looks like that is the common denominator in the fields where the formatter is needed but not available?

chrisarusso commented 10 years ago

@knowledges33ker,

I actually ended up discovering a drupal hook (read here: https://api.drupal.org/api/drupal/includes%21common.inc/function/format_username/7) that I ended up replacing with the old way of doing things with the custom fomatter. Please look through wherever that formatter was used and verify that it's still working as expected. This did, in turn, fix the current view discussed: count-tester

knowledges33ker commented 10 years ago

OK, I see where the username is being rewritten as the first name last name. What I don't get is that now the first name last name formatter is no longer in the dropdown menu. So is the solution you implemented forcing the first name last name in every instance by default?

knowledges33ker commented 10 years ago

I also see that this is the case on every other view as well

chrisarusso commented 10 years ago

I think we should be good, by default, everywhere now. It is a formatting of the username anywhere it's used to use first and last. You'll notice in the above referenced commit 557d3c6 that I removed much of the old code... so this is actually probably the best, most robust and future failproof way to go. I would consider this closed unless you can find a violation.

knowledges33ker commented 10 years ago

OK, that sounds good. So if I want to implement this in the install profile I'm working on (which is on my local machine) do I just grab the new cwcon custom module and overwrite it?

chrisarusso commented 10 years ago

Yep!

knowledges33ker commented 10 years ago

I think we are switching to the real name module for this functionality.