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\MenuLink.php uri() method and drop menu_link_uri() function replacing it's calls to $entity->uri() and clean-up uri_callback
at entity annotation.
Comment | File | Size | Author |
---|---|---|---|
#21 | menu_link-2010238-21.patch | 2.71 KB | tim.plunkett |
#14 | 2010238_14.patch | 1.65 KB | garphy |
#12 | 2010238_12.patch | 1.51 KB | benjy |
Comments
Comment #1
kgoel CreditAttribution: kgoel commentedComment #2
amateescu CreditAttribution: amateescu commentedChanged to the proper component.
Comment #3
kgoel CreditAttribution: kgoel commentedComment #4
garphy CreditAttribution: garphy commentedPatch in #3 was not applying correctly anymore on HEAD. Rerolled.
Comment #5
rbayliss CreditAttribution: rbayliss commentedThis returns the literal text '$menu_link->link_path{ID}'. Path should just be $this->link_path (no quotes).
Comment #6
garphy CreditAttribution: garphy commentedWell, actually I don't understand why @kgoel didn't use only $this->menu_link as in the original menu_link_uri() callback...
Why do we need to append any id to the path ?
Comment #7
rbayliss CreditAttribution: rbayliss commentedTthere is no reason to append an ID. Just $this->link_path is enough.
Comment #8
garphy CreditAttribution: garphy commentedPatch updated accordingly.
Comment #9
garphy CreditAttribution: garphy commentedBTW, Entity::uri() now takes a $rel parameter and I'm not really sure about how to handle that.
Can't we eventually end up to directly use annotations on the MenuLink class to provide the right template ?
Comment #10
garphy CreditAttribution: garphy commentedFixed stupid $this mistake.
Comment #11
areke CreditAttribution: areke commentedThis patch needs to be re-rolled because it no longer applies against the current HEAD.
Comment #12
benjy CreditAttribution: benjy commentedRe-rolled.
Comment #13
RainbowArrayPatch no longer applies.
Comment #14
garphy CreditAttribution: garphy commentedRerolled.
Comment #15
dawehnerWe should return 'route_name' and 'route_parameters' if available. For external links we still need to return the path.
Comment #16
garphy CreditAttribution: garphy commentedComment #17
garphy CreditAttribution: garphy commentedWell... it seems that there's no more uri() method in Entity class, nor in EntityInterface so I'm a bit lost now.
Is it still "uri()" the right method to implement ?
Comment #18
dawehnerThere is url().
Comment #19
garphy CreditAttribution: garphy commentedComment #20
andypostComment #21
tim.plunkettThis is major until all URI callbacks are gone, since you cannot use the url() method with a callback if you have no templates.
Comment #23
BerdirI think #2301319: MenuLinkNG part5: Remove dead code; and party! will remove this, so closing as duplicate.