craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.21k stars 624 forks source link

Error in routes from Control Panel #1741

Closed fractorr closed 7 years ago

fractorr commented 7 years ago

Description

I have been playing with Routes in the admin and having an issue with it. I am getting odd behavior in the templates but seems to work when using config/routes.php

Steps to reproduce

Here is what I have tried.

Admin Panel

product/view/(slug)       /product/index             Gets 404 error - Template not found
product/view/(*)          /product/index             Gets 404 error - Template not found
product/view/test         /product/index             No error - works as expected

config/routes.php

return [
    'product/view/<slug:[^\/]+>' => ['template' => 'product'],
];

Additional info

angrybrad commented 7 years ago

Just to clarify, are you saying the routes work as expected when you define them in config/routes.php, but they don't work as expected when you define them in the Control Panel under Settings->Routes?

carlcs commented 7 years ago

@takobell it’s just the routes stored to the DB, yes. There seems to be an issue with too many characters being escaped.

brandonkelly commented 7 years ago

@fractorr Can you post a screenshot of your Settings → Routes index view please?

brandonkelly commented 7 years ago

Closing due to lack of response.

carlcs commented 7 years ago
bildschirmfoto 2017-07-07 um 14 55 15

@brandonkelly I just re-created that setup @fractorr is describing and can confirm that with the above route setup in Settings > Routes, requests to http://craft3.dev/product/view/test respond with 404 errors.

Whereas the following works without issues:

'product/view/<slug:[^\/]+>' => ['template' => '_product'],
brandonkelly commented 7 years ago

@carlcs Thanks, can confirm that doesn't work.