Skip to content

Commit 3e703b2

Browse files
committed
bugfix for ratings list
1 parent 2f92ce4 commit 3e703b2

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

app/code/Magento/Review/view/frontend/templates/customer/list.phtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ $reviewHelper = $block->getData('reviewHelper');
4343
<div class="rating-summary">
4444
<span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
4545
<div class="rating-result"
46+
id="rating-result_<?= /* @noEscape */ $block->escapeHtml($review->getId()) ?>"
4647
title="<?= /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) ?>%">
4748
<span>
4849
<span>
@@ -51,9 +52,10 @@ $reviewHelper = $block->getData('reviewHelper');
5152
</span>
5253
</div>
5354
</div>
54-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
55+
<?= /* @noEscape */
56+
$secureRenderer->renderStyleAsTag(
5557
"width:" . /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) . "%;",
56-
'div.rating-summary div.rating-result>span:first-child'
58+
'#rating-result_' . $block->escapeHtml($review->getId()) . ' span'
5759
) ?>
5860
<?php endif; ?>
5961
</td>

app/code/Magento/Review/view/frontend/templates/customer/recent.phtml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@
3030
<?php $rating = $_review->getSum() / $_review->getCount() ?>
3131
<div class="rating-summary">
3232
<span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
33-
<div class="rating-result" title="<?= $block->escapeHtmlAttr($rating) ?>%">
33+
<div class="rating-result"
34+
id="rating-result_<?= /* @noEscape */ $block->escapeHtml($_review->getId()) ?>"
35+
title="<?= $block->escapeHtmlAttr($rating) ?>%">
3436
<span>
3537
<span><?= $block->escapeHtml($rating) ?>%</span>
3638
</span>
3739
</div>
38-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
39-
"width:". $block->escapeHtmlAttr($rating) . "%",
40-
'div.rating-result>span:first-child'
40+
<?= /* @noEscape */
41+
$secureRenderer->renderStyleAsTag(
42+
"width:" . $block->escapeHtmlAttr($rating) . "%",
43+
'#rating-result_' . $block->escapeHtml($_review->getId()) . ' span'
4144
) ?>
4245
</div>
4346
<?php endif; ?>

app/code/Magento/Review/view/frontend/templates/helper/summary.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $urlForm = $block->getReviewsUrl() . '#review-form';
2121
<span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
2222
<div class="rating-result"
2323
id="rating-result_<?= /* @noEscape */ $block->getProduct()->getId() ?>"
24-
title="<?= $block->escapeHtmlAttr($rating); ?>%"
24+
title="<?= $block->escapeHtmlAttr($rating) ?>%"
2525
>
2626
<span>
2727
<span>

0 commit comments

Comments
 (0)