Skip to content

Commit

Permalink
allows for a fallback of drupal user name if civi display name is not…
Browse files Browse the repository at this point in the history
… on user object
  • Loading branch information
Mark committed Apr 5, 2017
1 parent 440da9f commit 17a3d90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reservations_operator_history.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = CMA Reservations: Operator History
description = Module will create a new table and store reservation operator history
package = Community Media Advanced
core = 7.x
version = 7.x-1.0
version = 7.x-1.3
project = reservations_operator_history
project status url = https://github.com/cm-advanced/reservations_operator_history
dependencies[] = viewfield
Expand Down
3 changes: 2 additions & 1 deletion reservations_operator_history.module
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ function reservations_operator_history_reservation_field($row) {

function reservations_operator_history_operator_field($row) {
$user = user_load($row->uid);
$link = l($user->realname, 'user/'.$row->uid);
$name = (isset($user->realname) && $user->realname) ? $user->realname : $user->name;
$link = l($name, 'user/'.$row->uid);
return $link;
}

Expand Down

0 comments on commit 17a3d90

Please sign in to comment.