Skip to content

Commit

Permalink
updated findTemplate to use find the correct array key for results
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Greene committed Sep 17, 2019
1 parent b380878 commit 470eef2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Helper/Twig_Loader_DynamicContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 470eef2

Please sign in to comment.