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
If there is time, carried over from last week as we didn't have time to look at it then, I would welcome feedback on the approach I've taken to: [A11Y] Update aria role on...
July 16th, 2026 - Weekly Meetings
If there's some time left after discussing code signing (yay!)... 1. Friendly reminder: usage stats are still broken Didn't data get fetched at all (broken parser) or is it a display...
July 16th, 2026 - Weekly Meetings
Sorry - it is the field_group module. However, last night I switched off proxying to the site and proved to Cloudflare Support that it was NOT a Backdrop issue. After a thorough...
Cloudflare specific advice needed [SOLVED]