From 470eef29ec33f9d7288ea1cbb724e157e23dbdc3 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Tue, 17 Sep 2019 13:18:24 -0500 Subject: [PATCH] updated findTemplate to use find the correct array key for results --- Helper/Twig_Loader_DynamicContent.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Helper/Twig_Loader_DynamicContent.php b/Helper/Twig_Loader_DynamicContent.php index 95aec47..7538908 100644 --- a/Helper/Twig_Loader_DynamicContent.php +++ b/Helper/Twig_Loader_DynamicContent.php @@ -133,9 +133,13 @@ private function findTemplate($resourceAlias) if (count($result) === 0) { return null; } - return $result[1]; // Strange, but result is in the element 1 not 0... - } + /**** The result array key is the dynamic content ID - So use array_keys and get the first (and only) found key ****/ + $keys = array_keys($result); + + return $result[$keys[0]]; + } + /** * Check if we have the source code of a template, given its name. *