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\User.php uri() method and drop user_uri() function replacing it's calls to $account->uri()
Comment | File | Size | Author |
---|---|---|---|
#15 | 2008616-15.patch | 963 bytes | lokapujya |
Comments
Comment #1
markie CreditAttribution: markie commentedSo I am taking a stab at this but I want to clarify a few things. Right now I have the following:
I put this in Entity/User.php because I found the id() function in here.
My first question is, shouldn't both of these functions be in the UserInterface class? (Drupal\user\UserInteface.php) or more to the point, why not?
Comment #2
andypostboth
id()
anduri()
are declared inEntityInterface
Once you drop
drop it from annotation
Comment #3
kgoel CreditAttribution: kgoel commentedComment #4
joachim CreditAttribution: joachim commentedPatch doesn't apply for me -- can't find the file.
Comment #5
herom CreditAttribution: herom commentedPatch rerolled.
Comment #6
tstoecklerLooks good.
Comment #7
BerdirThis should probably wait for #2083615: Use links annotation for config entity URI like for content entities and then just drop it, because it will no longer be used after that landed, I think :)
Comment #8
tstoecklerI only briefly skimmed that patch, but doesn't that cover config entities only?
Comment #9
BerdirTrue, it does, but only because content entities already implement it. However, the canonical URL apparently still calls out to the callback and doesn't use the annotation.
That makes what I said incorrect, but it's still wrong to override uri() like this and ignore the $rel argument. Not sure what the plan is with that, exactly...
Comment #10
tstoecklerAhh, yes you're right. That should not be done. I had overlooked that fact. Thanks for the explanation!
Comment #10.0
tstoecklerUpdated issue summary.
Comment #11
jmarkel CreditAttribution: jmarkel commentedComment #12
jmarkel CreditAttribution: jmarkel commentedAs far as I can see, EntityInterface::uri() no longer exists.
Trying to track down where it went and why, and see if this issue is relevant anymore.
Comment #13
BerdirSee #2010132: Canonical taxonomy term link for forum vocabulary is broken, try to just remove the definition and callback method, it's apparently not used anymore.
Comment #14
andypostComment #15
lokapujyaComment #16
BerdirNice.
Comment #17
alexpottWe need a change record. user_uri was a D7 function https://api.drupal.org/api/drupal/modules%21user%21user.module/function/...
Comment #18
alexpottI guess all the *_uri removals should share a change record.
Comment #19
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 #20
alexpottCommitted aa5bf1b and pushed to 8.x. Thanks!