Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Add author column on drafts and other revisions tables.
Comment | File | Size | Author |
---|---|---|---|
#1 | state_machine-add-author-column-1989348-1.patch | 1.71 KB | Elijah Lynn |
Comments
Comment #1
Elijah LynnComment #2
douggreen CreditAttribution: douggreen commentedI'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?
Comment #3
Elijah LynnYeah, I wasn't sure about that either. Thanks!
Comment #4
Elijah LynnHey 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()
Comment #5
fmitchell CreditAttribution: fmitchell commentedhttp://drupalcode.org/project/state_machine.git/commit/2524c67