Skip to content

Commit

Permalink
Merge pull request Logicify#7 from InfiniteScripts/master
Browse files Browse the repository at this point in the history
updated findTemplate to use find the correct array key for results
  • Loading branch information
corvis authored Sep 17, 2019
2 parents b380878 + 470eef2 commit 510c369
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 510c369

Please sign in to comment.