From e213c3e7d8970d8b89fdacc17012df2670865b7f Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 12 Oct 2020 21:58:20 +0200 Subject: [PATCH] Fix when adding poll = template tibiacom broken With Exception and red message --- templates/tibiacom/boxes/poll.php | 2 +- templates/tibiacom/boxes/templates/poll.html.twig | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/tibiacom/boxes/poll.php b/templates/tibiacom/boxes/poll.php index 266f3f6c..10762b20 100644 --- a/templates/tibiacom/boxes/poll.php +++ b/templates/tibiacom/boxes/poll.php @@ -6,7 +6,7 @@ if(PAGE !== 'news') { $poll = $db->query('SELECT `id`, `question` FROM `z_polls` WHERE end > ' . time() . ' ORDER BY `end` LIMIT 1'); if($poll->rowCount() > 0) { - $poll = $poll->fetch(); + $poll = $poll->fetch(PDO::FETCH_ASSOC); $twig->display('poll.html.twig', array( 'poll' => $poll )); diff --git a/templates/tibiacom/boxes/templates/poll.html.twig b/templates/tibiacom/boxes/templates/poll.html.twig index 07d26a33..0b643ee5 100644 --- a/templates/tibiacom/boxes/templates/poll.html.twig +++ b/templates/tibiacom/boxes/templates/poll.html.twig @@ -1,7 +1,6 @@ -
-
{{ poll['question'] }}
-
+