The comment author field gets the name property from the comment. However this property only has a value if an anonymous user has entered his or her name whilst creating the comment.

Instead the field should use the getAuthorName() method on the comment entity.

CommentFileSizeAuthor
#2 ds_comment-author_2919055_2.patch1.49 KBwesleydv
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wesleydv created an issue. See original summary.

wesleydv’s picture

The attached patch should fix the issue.

wesleydv’s picture

Status: Active » Needs review
effortDee’s picture

Is this the same as author/submiited by not showing as a field on comment types if DS is used?

szantog’s picture

+++ b/src/Plugin/DsField/Comment/CommentAuthor.php
@@ -2,7 +2,8 @@
+use Drupal\ds\Plugin\DsField\DsFieldBase;

You shouldn't switch to DsFieldBase, Field does the same.

Nevermind, I told nothing.

szantog’s picture

Another approach + a small improvement: #2941900: Link comment author

swentel’s picture

Version: 8.x-3.x-dev » 5.0.x-dev
swentel’s picture

Status: Needs review » Closed (duplicate)