Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Jul 2013 at 01:06 UTC
Updated:
29 Jul 2014 at 22:40 UTC
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 extendingEntityNGand are defining link patterns are already using them. For those entities we can safely remove theurl_callbackannotation and drop the old procedural callback. Proposal: Removeuri_callbackannotation and related procedural callbacks.EntityNGbased entities that are not defining link templates. A new hypotheticalEntityNGnot defining links will fallback to olduri_callbackmechanism when calling->uri()without parameters because ofThat is looking up to parent
Entitymethod that is still usinguri_callback. Proposal: Break here the call to the legacy mechanism by replacing with:ConfigEntityBase) onEntity, are not inheriting theEntityNGnew->uri()method and are still using the procedural callback. Adopt one of next proposals:->uri()(that is using link templates) method toConfigEntityBaseand 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 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.