Add author column on drafts and other revisions tables.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Elijah Lynn’s picture

Status: Active » Needs review
FileSize
1.71 KB
douggreen’s picture

I'm not entirely clear when to use theme('username') verses format_username. But I do know that theme username bypasses the drupal_alter. Should this use format_username?

Elijah Lynn’s picture

Status: Needs review » Needs work

Yeah, I wasn't sure about that either. Thanks!

Elijah Lynn’s picture

Status: Needs work » Needs review

Hey Doug,

I did some research and talked with my team (ericduran & bleen18) about this and from my understanding we should use theme('username',..) most of the time. If one wants to alter it they should be able to do so via a hook_username_alter() which will be invoked by format_username() which invokes drupal_alter(). All of this stems from template_preprocess_username() which calls format_username().

I just tested a hook_username_alter on the above patch and it does appear to change the username.

I may be wrong about this and Eric seems to recall a memory of an incident that you may be referring to. Can you elaborate on why using theme('username',..) won't allow for an alter earlier on in the processing (via template_preprocess_username().

Below is the flow I am envisioning:

1.) template_preprocess_username()
1.1) format_username($account);
1.3) drupal_alter('username', $name, $account);
2.) ......
3.) theme_username()

fmitchell’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.