[wp-trac] [WordPress Trac] #35462: update_term_cache and deleting object_id
WordPress Trac
noreply at wordpress.org
Thu Jan 14 23:06:08 UTC 2016
#35462: update_term_cache and deleting object_id
--------------------------+-----------------------------
Reporter: berengerzyla | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 4.4.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I have been getting a lot of errors (since -don't-remember-which-update),
even preventing some pages to load.
Here it is:
{{{
PHP Notice: Undefined property: stdClass::$object_id in […]/wp-
includes/taxonomy.php on line 3619
}}}
Tracked down the issue to {{{update_object_term_cache}}}.
If I dump the content of the {{{$term}}} there, it indeed does not have
any {{{object_id}}} property.
Debugged all the way up to find the culprit in {{{update_term_cache}}}:
{{{
// Create a copy in case the array was passed by reference.
$_term = $term;
// Object ID should not be cached.
unset( $_term->object_id );
}}}
I haven't checked more clearly why, but this simple copy does not work in
my install. Really cloning the object with {{{$_term = clone $term;}}}
fixes the issue.
WP 4.1.1
PHP 7.0.1-4
nginx 1.9.7
WPML
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35462>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list