Description of the need
Redirecting to a node or other entity page is unnecessarily cumbersome. Common approaches include:
// Manual assembly for known entity types:
backdrop_goto('node/' . $node->nid);
// Using URI for general entities:
$uri = $entity->uri();
backdrop_goto($uri['path'], $uri['options']);
// Trying to shorthand the above into a single line:
backdrop_goto($entity->uri()['path']);
Proposed solution
Create a short-hand wrapper function around backdrop_goto()
that makes redirecting to entities easier.
function entity_goto(Entity $entity) {
$uri = $entity->uri();
backdrop_goto($uri['path'], $uri['options']);
}
Alternatives that have been considered
Maybe also create $entity->goto()
method?
GitHub Issue #:
5838
Recent comments
Thanks! I tested PayPal WPS (since I also use it in my Drupal 7 Commerce shop). With the PayPal server SANDBOX mode (no real payment transaction, just simulated). And everything...
Commerce shop system from Drupal
Peter, I've done an initial port of Commerce PayPal. While I haven't tested it, I think it should work, as the module is not too complex. https://github.com/backdrop-contrib/...
Commerce shop system from Drupal
Glad you finally found it! Someone really needs to port commerce_paypal.
Commerce shop system from Drupal