Repository navigation
Conversation
…ulate_terms()`. When a query returns term rows with an `object_id` or `count`, `populate_terms()` assigns those values to the result of `get_term()` before checking it. If the term no longer resolves, for example because a persistent cache still lists a deleted term or a `get_term` filter returns null, this is a fatal error: "Attempt to assign property "object_id" on null". Skip such terms, as the function already does for the other branch and as [60661] did for child terms. See #59785. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
This comment has been minimized.
This comment has been minimized.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
The guard in `WP_Term_Query::populate_terms()` narrows `$term` to `WP_Term`, so the baselined error about `WP_Error|WP_Term` no longer occurs there. See #59785. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In
WP_Term_Query::populate_terms(), rows that carry anobject_idorcountare assigned to the result ofget_term()before it is checked. When the term no longer resolves, for example because a persistent cache still lists a deleted term or aget_termfilter returns null, this is a fatal error:Attempt to assign property "object_id" on null.The function already discards anything that is not a
WP_Terma few lines later, so this skips such terms before the assignments, the same guard [60661] added for child terms in #63877. One guard covers both theobject_idand thecountassignment.Trac ticket: https://core.trac.wordpress.org/ticket/59785
Testing
vendor/bin/phpunit --filter test_unresolvable_term_with_object_id_should_be_discardedfails without the patch withAttempt to assign property "object_id" on nulland passes with it.vendor/bin/phpunit --group taxonomy(1122 tests) passes.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: reproducing the fatal in trunk, drafting the fix and test, and running them. I reviewed every line.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
🤖 Generated with Claude Code