diff --git a/mozilla/webtools/addons/public/tpl/addon.tpl b/mozilla/webtools/addons/public/tpl/addon.tpl index eca676b3af4..31e43636ebc 100644 --- a/mozilla/webtools/addons/public/tpl/addon.tpl +++ b/mozilla/webtools/addons/public/tpl/addon.tpl @@ -102,7 +102,13 @@ Works with:
  • {$addon->Comments[comments].CommentVote} out of 5

    {$addon->Comments[comments].CommentTitle|strip_tags}

    -

    by {$addon->Comments[comments].CommentName|strip_tags}, {$addon->Comments[comments].CommentDate|date_format}

    +

    by +{if $addon->Comments[comments].CommentName} +{$addon->Comments[comments].CommentName|strip_tags} +{else} +{$addon->Comments[comments].UserName|strip_tags} +{/if} +, {$addon->Comments[comments].CommentDate|date_format}

    {$addon->Comments[comments].CommentNote|strip_tags}

    {$addon->Comments[comments].helpful_yes} out of {$addon->Comments[comments].helpful_total} viewers found this comment helpful
    Was this comment helpful? Yes | No

    diff --git a/mozilla/webtools/addons/public/tpl/comments.tpl b/mozilla/webtools/addons/public/tpl/comments.tpl index 7911d98be63..c78c644244a 100644 --- a/mozilla/webtools/addons/public/tpl/comments.tpl +++ b/mozilla/webtools/addons/public/tpl/comments.tpl @@ -55,7 +55,13 @@ Next Page »
  • {$addon->Comments[comments].CommentVote}out of 5

    {$addon->Comments[comments].CommentTitle|strip_tags}

    -

    by {$addon->Comments[comments].CommentName|strip_tags}, {$addon->Comments[comments].CommentDate|date_format}

    +

    by +{if $addon->Comments[comments].CommentName} +{$addon->Comments[comments].CommentName|strip_tags} +{else} +{$addon->Comments[comments].UserName|strip_tags} +{/if} +, {$addon->Comments[comments].CommentDate|date_format}

    {$addon->Comments[comments].CommentNote|strip_tags}

    {$addon->Comments[comments].helpful_yes} out of {$addon->Comments[comments].helpful_total} viewers found this comment helpful
    Was this comment helpful? Yes | No

    diff --git a/mozilla/webtools/addons/shared/lib/addon.class.php b/mozilla/webtools/addons/shared/lib/addon.class.php index d2630222eaa..691e514ad18 100644 --- a/mozilla/webtools/addons/shared/lib/addon.class.php +++ b/mozilla/webtools/addons/shared/lib/addon.class.php @@ -323,9 +323,14 @@ class AddOn extends AMO_Object { CommentVote, `helpful-yes` as helpful_yes, `helpful-no` as helpful_no, - `helpful-yes` + `helpful-no` as helpful_total + `helpful-yes` + `helpful-no` as helpful_total, + UserName FROM feedback + LEFT JOIN + userprofiles + ON + userprofiles.UserID = feedback.UserID WHERE ID = '{$this->ID}' AND CommentVote IS NOT NULL