Skip to content

Commit 9f97824

Browse files
Fix weak equality check for reputation display
1 parent ef356f4 commit 9f97824

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

locallib.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,7 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
13011301
html_writer::link($postinguser->profilelink, $postinguser->fullname)
13021302
: $postinguser->fullname;
13031303
$mustachedata->byrating = $postuserrating;
1304+
$mustachedata->showrating = $postuserrating !== null;
13041305

13051306
// Set options for the post.
13061307
$options = new stdClass();

templates/answer.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
{{{ picture }}}
7575
</div>
7676
<div class="user-details">
77-
{{{ byname }}} {{#byrating}}({{#pix}}star, moodleoverflow, {{#str}}reputation, moodleoverflow{{/str}}{{/pix}}<span>{{ byrating }}</span>){{/byrating}}
77+
{{{ byname }}} {{#showrating}}({{#pix}}star, moodleoverflow, {{#str}}reputation, moodleoverflow{{/str}}{{/pix}}<span>{{ byrating }}</span>){{/showrating}}
7878
<div class="-flair">
7979
<div class="user-action-time">
8080
{{ bydate }}

templates/question.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<div class="author" role="heading" aria-level="2">
6262
<span class="user-details">
6363
by {{{ byname }}}
64-
{{#byrating}}({{#pix}}star, moodleoverflow, {{#str}}reputation, moodleoverflow{{/str}}{{/pix}}<span>{{ byrating }}</span>){{/byrating}} -
64+
{{#showrating}}({{#pix}}star, moodleoverflow, {{#str}}reputation, moodleoverflow{{/str}}{{/pix}}<span>{{ byrating }}</span>){{/showrating}} -
6565
{{ bydate }}
6666
</span>
6767
</div>

0 commit comments

Comments
 (0)