Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Entity annotation has inherited a reference to the legacy procedural URI callback in uri_callback
key. In the same time there we are able to annotate the URI using the links = {"canonical" = "/entity/{entity}", ...}
. See https://drupal.org/node/2020491
Deprecate the procedural callbacks.
Comments
Comment #1
claudiu.cristeaFrom IRC:
Comment #1.0
claudiu.cristeaFix description.
Comment #2
claudiu.cristeaI'm back with some conclusion and proposals after researched a little bit.
url()
was implemented to use link templates inEntityNG
. So, all entities that are extendingEntityNG
and are defining link patterns are already using them. For those entities we can safely remove theurl_callback
annotation and drop the old procedural callback. Proposal: Removeuri_callback
annotation and related procedural callbacks.EntityNG
based entities that are not defining link templates. A new hypotheticalEntityNG
not defining links will fallback to olduri_callback
mechanism when calling->uri()
without parameters because ofThat is looking up to parent
Entity
method that is still usinguri_callback
. Proposal: Break here the call to the legacy mechanism by replacing with:ConfigEntityBase
) onEntity
, are not inheriting theEntityNG
new->uri()
method and are still using the procedural callback. Adopt one of next proposals:->uri()
(that is using link templates) method toConfigEntityBase
and link templates in configurable annotations.Entity::url()
method to use new template links and annotate link templates in configurables.Please comment on this.
Comment #3
larowlanUm what happens to forum?
It needs bundle based urls for taxonomy terms.
Comment #4
xjmSee also: #2047283: Improve documentation for EntityType::$links
Comment #5
BerdirWe have an existing issue for this, with discussions why this is a problem.
Comment #6
Crell CreditAttribution: Crell commentedBerdir: Where? Should this issue be closed as a dupe?
Comment #7
BerdirYeah, sorry, did not have time to look it up. Here it is: #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method. The biggest problem I think is that "Bundle-based URIs are no more supported for content entities" is correct for template-uris, but we actually *need* them in core, for forum. And yes of course should forums be a separate entity type and no, that won't happen in 8.x ;)
Comment #8
xjmYah, let's close this as a dupe and move the discussion over to #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method.
Comment #8.0
xjmChange summary.