core icon indicating copy to clipboard operation
core copied to clipboard

[Routes] Review route / url creation and redirection

Open cmfcmf opened this issue 10 years ago • 9 comments

  • [ ] Allow to edit module urls
  • [ ] Allow to make a custom route the default route: Let's say a module defines a route /modname/bla/test to it's TestController::test() action. Let's say the user adds a custom route (/my-fancy-custom-route) via the RoutesModule admin interface which also points to the TestController::test() action. It should be configurable which route is used by default by the generator (so whether $router->generate('testmodule_test_test') results in /modname/bla/test or /my-fancy-custom-route).
  • [ ] Make sure to use redirects (and not have duplicated urls): When there are two routes pointing to the same module/type/action (i.e. the user added a custom route), all routes except one should redirect to one single route). In the example above, either /my-fancy-custom-route would redirect to /modname/bla/test or vice versa.
  • [ ] Add url conflict checks: When you add a new custom route, there should be a simple check in place warning the user about possibly duplicated urls. Example: There already is a route /test/{id} and the user adds /test/6562 as a route, it should give a warning.
  • [x] Allow reloading urls of one single module
  • [x] Add reload routes of one module only option
  • [x]

you should write a handler and catch the Symfony\Component\Routing\Exception\RouteNotFoundException: [22:55:54] Craig Heydenburg: handle it more gracefully and redirect admin to reload the routes [22:56:06] Craig Heydenburg: or auto-reload routes on extension install

cmfcmf avatar Jul 15 '14 13:07 cmfcmf

you might check error handling in the 'rebuild all routes' routine. I had a need to rebuild the routes but have a module in mid-development that caused a fault in the rebuild and it totally failed. It would be good if this was handled better.

craigh avatar Jul 18 '14 12:07 craigh

I don't know if this is same thing but reloading all the routes gives me an error "The server encountered an internal error or misconfiguration and was unable to complete your request... 302 Found and additional 404" (it is reloading all the routes eventually) and that's only on external server it is working locally.

I had similar problem as Craig when half of the default routes where gone I had to reload whole db from backup.

Kaik avatar Jul 18 '14 13:07 Kaik

Allow reloading urls from one single module :+1: :pray:

craigh avatar Sep 21 '14 15:09 craigh

@cmfcmf I need more information about these items if I am to be able to help.

I did attempt to force an exception with a few invalid routes and they didn't blow up the site. maybe that issue is solved?

craigh avatar Nov 07 '14 01:11 craigh

The first point in the task list, Allow editing module urls, is probably already done?

Guite avatar Nov 16 '14 13:11 Guite

@cmfcmf I need more information about these items if I am to be able to help.

I've added more information to the first post.

I did attempt to force an exception with a few invalid routes and they didn't blow up the site. maybe that issue is solved?

It might be solved indeed.

The first point in the task list, Allow editing module urls, is probably already done?

No, it is currently impossible to edit routes which aren't custom routes users created.

cmfcmf avatar Nov 17 '14 20:11 cmfcmf

@cmfcmf should we (or can we) postpone these other items until 2.0.0? if not, is there any way you can complete them before 31 Jan?

craigh avatar Jan 17 '15 14:01 craigh

I will have some time the next weekend and see what I can do.

cmfcmf avatar Jan 17 '15 19:01 cmfcmf

Turns out I won't have time the next weekend :-1: I think this isn't a blocker though, and might even be postponed to something like 1.4.1 (if it'll ever exist) or 2.0.0 otherwise.

cmfcmf avatar Jan 20 '15 18:01 cmfcmf

Closing as won't fix as our custom routing system will be removed.

Guite avatar Aug 16 '22 09:08 Guite