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.
If entity type or entity bundle has uri_callback specified and this callback is used(when requested link is not defined in entity's annotation) the relationship argument is not passed to the uri_callback so the callback cannot distinguish the context of the link.
Comment | File | Size | Author |
---|---|---|---|
#8 | entity_uri_callback-2252411-8.patch | 755 bytes | hitesh-jain |
#1 | entity-uti-callback-relationship-argument.patch | 561 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
tim.plunkettWe're actually working to remove support for uri_callbacks. See #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method for the issue and #2046289: Deprecate entity uri procedural callbacks (uri_callback) for the original discussion.
But if we choose to do this, we need test coverage.
Comment #3
jhedstromEven though many of the issues linked from #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method are completed, the
Entity::urlInfo()
method still uses the callback. I didn't immediately see an issue in the meta to convert the Entity class itself. Config entities, and possibly others, still use this method.Comment #4
dawehner@tim.plunkett
Does that mean that on the longrun you cannot longer swap out the URI callback like it used to be?
Instead people would replace the special entity class and override the various uri/url methods?
Comment #5
tim.plunkett@dawehner, correct
Comment #6
jhedstromPatch no longer applies, and this still needs tests if it is still relevant.
Comment #7
hitesh-jain CreditAttribution: hitesh-jain at Acquia commentedComment #8
hitesh-jain CreditAttribution: hitesh-jain at Acquia commentedRerolled Patch to Latest Release . Thanks!
Comment #9
neetu morwani CreditAttribution: neetu morwani as a volunteer commentedComment #10
neetu morwani CreditAttribution: neetu morwani as a volunteer commentedComment #11
RavindraSingh CreditAttribution: RavindraSingh as a volunteer and at Srijan | A Material+ Company commentedtests needs for code updates.
debuging can be done in
public function testUrlInfo($entity_class, $link_template, $expected, $langcode = NULL) {
Comment #24
catchI'm going to go ahead and mark this duplicate of #2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method, we should finish the deprecation.