Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300511

Add an API for comparing the (current) route name that takes into account deprecated routes

$
0
0

Problem/Motivation

In #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name we added the ability to deprecate routes, but we later found that usages of RouteMatchInterface::getRouteName() for checking against specific route name(s) are problematic because they can't take into account deprecated route names.

Proposed resolution

Add a method on \Drupal\Core\Routing\RouteMatchInterface that can be used to compare the route name against a given string (or a list of them), and document that RouteMatchInterface::getRouteName() is discouraged for this purpose. That method can't be deprecated because there are valid use-cases for retrieving the route name, e.g. the route and route.name cache contexts, getting local tasks or actions for the current route, etc.

Remaining tasks

Discuss, implement the new method, etc.

User interface changes

Nope.

Introduced terminology

N/A

API changes

API addition: a new method on \Drupal\Core\Routing\RouteMatchInterface.

Data model changes

Nope.

Release notes snippet

TBD.


Viewing all articles
Browse latest Browse all 300511

Trending Articles


Download: Don Kingston ft General Kanene – Landlord(Prod by Great Pro)


Neem Baba Extra Questions Answer Class 6 English Poorvi


Deceased’s neighbours puzzled


CVP measurement


Practice Sheet of Right form of verbs for HSC Students


The Old Stag Class 4 Extra Questions MCQ English Chapter 5


Shaun Waring – Buxton


FREE BMW HUTOOLS 2.6 PRE


Verna Mae Skarsten


Mahakal Attitude Status



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>