Closed tonsinn closed 1 year ago
Can you post the screenshot of your rewrite record configuration, please?
Isn't the route configuration missing? The routing.yml
says it is defined via annotations:
However, there are no annotations for the RewriteController
.
@fritzmg it's not, the routes are added via UrlRewriteLoader
, where we set the _controller
attribute.
@tonsinn I am unable to reproduce your problem, unfortunately. Would you be able to set up a dev system on a remote server and send me the Contao + SFTP access details at kamil.kuzminski@terminal42.ch?
@tonsinn thank you for the access details, I was able to track down the problem. I have created the pull request #38 and once it's merged, the problem should be gone. I have also hot patched your system, so it's already working there 😉
@qzminski thank you. Great job!
simple rewrite not working in a fresh Contao 5 installation: test123 [test123.html → {{link_url::99}}, 301 (Priorität: 0)]
in var/logs I find: [2022-12-17T10:32:20.356305+01:00] request.INFO: Matched route "url_rewrite_0". {"route":"url_rewrite_0","route_parameters":{"_route":"url_rewrite_0","_controller":"terminal42_url_rewrite.rewrite_controller:indexAction","_url_rewrite":"Terminal42\UrlRewriteBundle\ConfigProvider\DatabaseConfigProvider:1"},"request_uri":"https://www..../test123.html","method":"GET"} [] [2022-12-17T10:32:20.363238+01:00] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The controller for URI "/test123.html" is not callable: Controller "terminal42_url_rewrite.rewrite_controller:indexAction" does neither exist as service nor as class." at /www/htdocs/.../vendor/symfony/http-kernel/Controller/ControllerResolver.php line 79 {"exception":"[object] (InvalidArgumentException(code: 0): The controller for URI \"/test123.html\" is not callable: Controller \"terminal42_url_rewrite.rewrite_controller:indexAction\" does neither exist as service nor as class. at /www/htdocs/.../vendor/symfony/http-kernel/Controller/ControllerResolver.php:79)\n[previous exception] [object] (InvalidArgumentException(code: 0): Controller \"terminal42_url_rewrite.rewrite_controller:indexAction\" does neither exist as service nor as class. at /www/htdocs/.../vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:57)\n[previous exception] [object] (Error(code: 0): Class \"terminal42_url_rewrite.rewrite_controller:indexAction\" not found at /www/htdocs/.../vendor/symfony/http-kernel/Controller/ControllerResolver.php:134)"} []