New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error by installing on Contao 5.2.7 #20
Comments
Fixed in |
Thanks for the quick investigation of the problem. Unfortunately I still get the error by activating it in a news archive:
The previous version of @symfony-cmf (2.1) still accepted strings and objects for $event->setRoute($route). The current master version (3.0), however, only accepts strings. |
Can you provide a PR with the necessary fixes? |
I would like to help, but unfortunately I wasn't able to fix it until now. |
By installing over the Contao Manager there are two Fatal errors:
Declaration of InspiredMinds\ContaoSimpleNewsUrls\Routing\RouteProvider::getRouteCollectionForRequest() must be compatible with Symfony\Cmf\Component\Routing\RouteProviderInterface::getRouteCollectionForRequest(Symfony\Component\HttpFoundation\Request $request): Symfony\Component\Routing\RouteCollection in C:\UwAmp\www\contao5\vendor\fritzmg\contao-simple-news-urls-bundle\src\Routing\RouteProvider.php on line 38
Declaration of InspiredMinds\ContaoSimpleNewsUrls\Routing\RouteProvider::getRoutesByNames($names): array must be compatible with Symfony\Cmf\Component\Routing\RouteProviderInterface::getRoutesByNames(?array $names = null): Traversable|array in C:\UwAmp\www\contao5\vendor\fritzmg\contao-simple-news-urls-bundle\src\Routing\RouteProvider.php on line 89
I installed it manually and changed the following lines in src/Routing/RouteProvider.php
line 37:
public function getRouteCollectionForRequest(Request $request)
to
public function getRouteCollectionForRequest(Request $request): RouteCollection
line 89:
public function getRoutesByNames($names): array
to
public function getRoutesByNames(?array $names = null): array
But now there is another issue in src/EventListener/RouterGenerateEventListener.php that I can't fix
Symfony\Cmf\Component\Routing\Event\RouterGenerateEvent::setRoute(): Argument #1 ($route) must be of type string, Contao\CoreBundle\Routing\Page\PageRoute given, called in ...\src\EventListener\RouterGenerateEventListener.php on line 70
The text was updated successfully, but these errors were encountered: