[wp-trac] [WordPress Trac] #57587: Method get_term_link() isn't type save - (Attempt to read property "query_var" on bool)

WordPress Trac noreply at wordpress.org
Mon Jan 30 19:12:19 UTC 2023


#57587: Method get_term_link() isn't type save - (Attempt to read property
"query_var" on bool)
-------------------------------+------------------------------
 Reporter:  1benk1             |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Taxonomy           |     Version:  6.1.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by 1benk1):

 Unfortunately, not in the moment. We run a large website with WordPress
 and this message popped up in our monitoring immediately after a recent
 switch to PHP 8.1.

 I suspect that the call to get_taxonomy() in line 4584
 (https://github.com/WordPress/WordPress/blob/master/wp-
 includes/taxonomy.php#L4584) returns ''false'' and access to a boolean is
 not allowed, as is the case in line 4590.

 I'm trying to figure out under what circumstances the return value of
 get_taxonomy() in this method can be ''false'' and reproduce the whole
 thing.

 Actually, the only conceivable case is that a WP_Term object is passed to
 get_term_link() whose taxonomy property does not really exist.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57587#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list