From 470498f63c53366342b1e718511f4e80f8a109fd Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 18 Nov 2018 16:17:11 +0100 Subject: [PATCH] Page/Achievement * catch fatal error for achievements without criteria --- pages/achievement.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/achievement.php b/pages/achievement.php index 81219b6e..f5a0dba3 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -259,9 +259,13 @@ class AchievementPage extends GenericPage $scripts = []; // serverside extra-Data - $crtIds = array_column($this->subject->getCriteria(), 'id'); - Util::checkNumeric($crtIds); - $crtExtraData = DB::World()->select('SELECT criteria_id AS ARRAY_KEY, type AS ARRAY_KEY2, value1, value2, ScriptName FROM achievement_criteria_data WHERE criteria_id IN (?a)', $crtIds); + if ($crtIds = array_column($this->subject->getCriteria(), 'id')) + { + Util::checkNumeric($crtIds); + $crtExtraData = DB::World()->select('SELECT criteria_id AS ARRAY_KEY, type AS ARRAY_KEY2, value1, value2, ScriptName FROM achievement_criteria_data WHERE criteria_id IN (?a)', $crtIds); + } + else + $crtExtraData = []; foreach ($this->subject->getCriteria() as $i => $crt) {