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()

CommentFileSizeAuthor
#7 node-2010162-7.patch1.11 KBtim.plunkett
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

There 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.

andypost’s picture

@Berdir the alterability still there (see forum_entity_bundle_info_alter()), so we just moving code to where it belongs and cleaning procedural remains

Berdir’s picture

The 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.

andypost’s picture

InternetDevels’s picture

Assigned: InternetDevels » Unassigned

.

InternetDevels’s picture

Issue summary: View changes

Updated issue summary.

andypost’s picture

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1.11 KB

To trigger node_uri(), you'd need to use $entity->urlInfo('something') where something is not a valid link relationship.
$node->url('something') will always return an empty string.

So, let's remove it.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Another trivial one :)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

node_uri was a drupal 7 function. Need a change record. I guess all the *_uri removals should share a change record.

alexpott’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record

Discussed 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.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2aa9831 and pushed to 8.x. Thanks!

  • alexpott committed 2aa9831 on 8.x
    Issue #2010162 by tim.plunkett | InternetDevels: Convert node_uri() to $...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.