Adding the ability to alter an entity's default URL route parameters

Created on 3 February 2018, over 6 years ago
Updated 12 April 2023, about 1 year ago

Problem/Motivation

Currently, there is no way to set default url route parameters besides modifying the entity class itself, but this may not always be practical. An example would be if a module would be adding link templates / entity routes to another module's entity.

Proposed resolution

I propose creating an alter hook call in the base Entity class' urlRouteParameter() method. See API Changes below.

Remaining tasks

Api documentation and hook already added. Needs peer review.

API changes

Entity API additions for a new alter hook hook_entity_url_route_parameters_alter().

There is currently another issue ( #2651974: field_ui_entity_operation() cannot respect route parameters because of incorrectly named routes → ) that I see as slightly related in the sense that another method could be created to encapsulate urlRouteParameters(), which itself could be public (such as getRouteParameters()), and that method could then call the alter hook after urlRouteParameters() is called to make sure that the alter hook is called after an entity's default parameters for every entity.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
Entity  →

Last updated 1 day ago

  • Maintained by
  • 🇬🇧United Kingdom @catch
  • 🇨🇭Switzerland @Berdir
  • 🇩🇪Germany @hchonov
Created by

🇺🇸United States grathbone

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024