Skip to content

Commit

Permalink
Merge pull request #273 from creative-commoners/pulls/3.1/name-that-m…
Browse files Browse the repository at this point in the history
…ember

FIX show name of members in summary tables
  • Loading branch information
ScopeyNZ committed Jan 11, 2019
2 parents 0535d29 + dc1f862 commit 20c6a50
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Model/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class Comment extends DataObject
* {@inheritDoc}
*/
private static $summary_fields = array(
'Name' => 'Submitted By',
'Email' => 'Email',
'getAuthorName' => 'Submitted By',
'getAuthorEmail' => 'Email',
'Comment.LimitWordCount' => 'Comment',
'Created' => 'Date Posted',
'Parent.Title' => 'Post',
Expand Down Expand Up @@ -450,6 +450,20 @@ public function getAuthorName()
}
}

/**
* Return the comment authors email address
*
* @return string
*/
public function getAuthorEmail()
{
if ($this->Email) {
return $this->Email;
} elseif ($author = $this->Author()) {
return $author->Email;
}
}

/**
* Generate a secure admin-action link authorised for the specified member
*
Expand Down

0 comments on commit 20c6a50

Please sign in to comment.