theodo/TheodoRogerCmsBundle — Issue #10: [Extension] TwigLoaderRepository getSource
Author: benja-M-1
Created: 2011-11-26 21:50:13+00:00
State: open

Hello,

As I'm working on the tests of the bundle I found some of them which don't pass.

One of them is the TwigLoaderRepositoryTest. It failed on `$source = $this->getTwigLoader()->getSource('page:homepage');` because the template 'homepage' doesn't exist. This is obviously true because the name of the expected template is 'Homepage'.

So after further investigation I found that the "sources" are searched by their name and their type (https://github.com/theodo/TheodoRogerCmsBundle/blob/master/Extensions/Twig/TwigLoaderRepository.php#L124, https://github.com/theodo/TheodoRogerCmsBundle/blob/master/Repository/ContentEntityRepository.php#L44), which can lead to problems like the one I came accross.

What do you think if the "sources" are searched by their slug instead of the name? And what about adding an index on this column (maybe unique) ?