diff --git a/src/Model/Comment.php b/src/Model/Comment.php index faa2b17..8c47ac6 100755 --- a/src/Model/Comment.php +++ b/src/Model/Comment.php @@ -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', @@ -450,6 +450,20 @@ class Comment extends DataObject } } + /** + * 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 *