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.
Part of #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method
Needs to implement Plugin\Entity\Node.php uri() method and drop node_uri() function replacing it's calls to $node->uri() and clean-up Node annotation uri_callback
.
Related issues:
#2010132: Canonical taxonomy term link for forum vocabulary is broken
#2008616: Convert user_uri() to $user->uri()
Comment | File | Size | Author |
---|---|---|---|
#7 | node-2010162-7.patch | 1.11 KB | tim.plunkett |
Comments
Comment #1
BerdirThere has been no discussion yet what exactly should happen with uri callbacks. Before we can do this, we need to discuss that first. Right now, it's possible to alter the callback, also for a specific bundle, this would kill that possibility.
Comment #2
andypost@Berdir the alterability still there (see
forum_entity_bundle_info_alter()
), so we just moving code to where it belongs and cleaning procedural remainsComment #3
BerdirThe alterability/callbacks is implemented in the label/uri methods in Entity. If you override those methods in Node, you can alter all you want, it won't have any effect.
In 7.x, entity.module has the concept of defaultLabel() and defaultUri() which allows to work around that.
Comment #4
andypost@Berdir anyway let's discuss this in #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method
Comment #5
InternetDevels CreditAttribution: InternetDevels commented.
Comment #5.0
InternetDevels CreditAttribution: InternetDevels commentedUpdated issue summary.
Comment #6
andypostComment #7
tim.plunkettTo trigger node_uri(), you'd need to use
$entity->urlInfo('something')
wheresomething
is not a valid link relationship.$node->url('something')
will always return an empty string.So, let's remove it.
Comment #8
BerdirAnother trivial one :)
Comment #9
alexpottnode_uri was a drupal 7 function. Need a change record. I guess all the *_uri removals should share a change record.
Comment #10
alexpottDiscussed with @Berdir in IRC - "that was never an API, it was just an internal callback, do we really need a change record for that?" , "we will need a change record for removing the uri_callback feature, but I think we can do that in the parent issue when they're all gone?"
I agree.
Comment #11
alexpottCommitted 2aa9831 and pushed to 8.x. Thanks!