terminal42 / contao-url-rewrite

Provides a back end module in Contao that allows you to specify url rewrites that are added to the Symfony Route collection
MIT License
15 stars 4 forks source link

Use RouterInterface instead of Router in the listener #11

Closed Toflar closed 5 years ago

Toflar commented 5 years ago

Otherwise Contao 4.7 won't work due to ChainRouter being passed instead.

We might want to add more optimizations for Contao 4.7 because we're using Symfony CMF Routing now and we'll be able to add the routes dynamically instead of deleting and updating cache files but this is a quick fix to ensure compat I guess 😄

leofeyer commented 5 years ago

This is the exception (in case it helps):

Argument 1 passed to Terminal42\UrlRewriteBundle\EventListener\RewriteContainerListener::__construct() must be an instance of Symfony\Bundle\FrameworkBundle\Routing\Router, instance of Symfony\Cmf\Component\Routing\ChainRouter given, called in …/var/cache/prod/ContainerFDpN0DW/getTerminal42UrlRewrite_Listener_RewriteContainerService.php on line 11

qzminski commented 5 years ago

Hey @leofeyer do you mind checking if 88d183a works for you? I would fix the unit tests afterwards.

leofeyer commented 5 years ago

Yes, it works. 👍