From ddb093ec48ea0beaedab6b7b13113b56415a88c1 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 19 Jul 2023 11:57:26 +0200 Subject: [PATCH] Fix highscores if there is only 1 record --- system/pages/highscores.php | 1 - system/templates/highscores.html.twig | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 95647893..dd2efa7b 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -311,7 +311,6 @@ if(config('highscores_balance')) /** @var Twig\Environment $twig */ $twig->display('highscores.html.twig', [ 'highscores' => $highscores, - 'totalRows' => $i - 1, 'list' => $list, 'skill' => $skill, 'skillName' => ($skill == SKILL_FRAGS ? 'Frags' : ($skill == SKILL_BALANCE ? 'Balance' : getSkillName($skill))), diff --git a/system/templates/highscores.html.twig b/system/templates/highscores.html.twig index 3b9224e2..2e32b7de 100644 --- a/system/templates/highscores.html.twig +++ b/system/templates/highscores.html.twig @@ -48,7 +48,7 @@ {% endif %} - {% if totalRows < 1 %} + {% if highscores|length < 1 %} No records yet. {% else %} {% set row = 0 %}