
Problem/Motivation
Follow up to #2443119: Views preview not working for REST display
Dynamic routes in views should be prefixed with views.view
rather then view
, to increase maintainability we need to think about introducing a prefix constant here.
While we are fixing routes in views, RouteSubscriber::alterRoutes()
should be cleaned up, we should not remove the route from the collection there since this is already handled in PathPluginBase::alterRoutes
Remaining tasks
Change dynamic route prefix from view
to views.view
Create a route prefix constant and us that to prefix any dynamic routes in views
Cleanup RouteSubscriber::alterRoutes()
User interface changes
None
API changes
Introduce prefix constant
Beta phase evaluation
Issue category | Task because view. works as a prefix |
---|---|
Prioritized changes | This reduces fragility by ensuring that routes creates by the Views module begin with views. And to make it easy to not introduce code bugs by incorrectly prefixing a views dynamic route. |
Disruption | Not disruptive - all existing sites will have to do is rebuild their menu router |
Comment | File | Size | Author |
---|---|---|---|
#8 | 2450055.8.patch | 20.11 KB | alexpott |
#8 | 6-8-interdiff.txt | 467 bytes | alexpott |
#6 | 2450055.6.patch | 19.9 KB | alexpott |
#6 | 4-6-interdiff.txt | 569 bytes | alexpott |
#4 | 2450055.4.patch | 19.91 KB | alexpott |
Comments
Comment #1
geertvd CreditAttribution: geertvd commentedComment #2
geertvd CreditAttribution: geertvd commentedComment #3
geertvd CreditAttribution: geertvd commentedComment #4
alexpottHere's a patch that carries out the tasks described in the issue summary. I guess we might have some simpletest failures.
Comment #6
alexpottMaybe the disruption of actually changing the prefix is not worth it.
Comment #8
alexpottComment #9
dawehnerIts a bit odd that its part of the interface ... I think, but I don't have a better suggestion.
What about at least naming it ROUTE_NAME_PREFIX?
+1 This is a bit easier to read.
I'm confused, didn't we used view.... as prefix above?
Comment #11
dawehnerIMHO at that point its a break without that much of a benefit. Feel free to disagree with me, but I would rather move this to D9.
Comment #12
catchHmm if we ever want to do this we should add the constant in 8.x and change the vale in 9.x
Comment #26
smustgrave CreditAttribution: smustgrave at Mobomo commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!