Skip to content

[6.x] Fix origin() on null when fetching nav tree with origin_id field - #15042

Merged
jasonvarga merged 1 commit into
6.xfrom
page-origin
Jul 21, 2026
Merged

[6.x] Fix origin() on null when fetching nav tree with origin_id field#15042
jasonvarga merged 1 commit into
6.xfrom
page-origin

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where fetching a nav tree via the REST API with ?fields=origin_id would throw a Call to a member function origin() on null error when the nav contained an item not linked to an entry (e.g. a custom URL or text label).

This was happening because Page has no origin() method, so the call was forwarded to the page's entry via __call, which is null for items without an entry reference.

This PR fixes it by giving Page an origin() method that safely returns null when there's no entry, matching its other entry-delegating methods like slug() and status().

Fixes #13315

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit d684df0 into 6.x Jul 21, 2026
23 checks passed
@jasonvarga
jasonvarga deleted the page-origin branch July 21, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call to a member function origin() on null when fetching Nav tree with origin_id field in Multisite

2 participants