I want to override certain node internal URLs using the 'uri callback' ability of entity_uri() and hook_entity_info(). Right now uc_product hard-codes the links to products as node/nid. It should not and use entity_uri() instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Version: 7.x-3.x-dev » 8.x-4.x-dev
Status: Needs review » Patch (to be ported)

Committed to 7.x-3.x, thanks! Needs porting to 8.x-4.x, there's also a few other places we assume node/$nid which could be replaced.

  • Commit 2d999e2 on 7.x-3.x authored by Dave Reid, committed by longwave:
    Issue #2246817 by Dave Reid: Cart products should use entity_uri().
    
TR’s picture

Bump.

longwave’s picture

Status: Patch (to be ported) » Needs review
FileSize
9.67 KB

The original issue doesn't seem to be a problem any more, but there are some simpler methods we can use instead of calling Url::fromRoute() and Link::createFromRoute() when we have an entity object available.

longwave’s picture

Orders can be similarly simplified.

  • longwave committed 67cb1b7 on 8.x-4.x
    Issue #2246817 by longwave: Simplify order link and URI generation.
    
  • longwave committed 739f7b9 on 8.x-4.x
    Issue #2246817 by longwave: Simplify node link and URI generation.
    
longwave’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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