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
I hope so too.... Thanks very much for the quick response, and have a Happy and productive 2026!!
Base table or view not found upgrading to 1.32.0, TRUNCATE {cache_book}
Good to hear you have sorted it. We haven't seen anything similar, so hopefully that is a one off.
Base table or view not found upgrading to 1.32.0, TRUNCATE {cache_book}
That fixed it, must have been something odd when the database was imported.
Base table or view not found upgrading to 1.32.0, TRUNCATE {cache_book}