[wp-trac] [WordPress Trac] #55955: Setting a 'NOT EXISTS' tax query in 'pre_get_posts' action triggers a fatal error in wp-includes/canonical.php

WordPress Trac noreply at wordpress.org
Wed Oct 26 20:06:32 UTC 2022


#55955: Setting a 'NOT EXISTS' tax query in 'pre_get_posts' action triggers a fatal
error in wp-includes/canonical.php
-------------------------------------------+------------------------------
 Reporter:  codesdnc                       |       Owner:  (none)
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Canonical                      |     Version:  6.0
 Severity:  normal                         |  Resolution:
 Keywords:  php8 has-patch has-unit-tests  |     Focuses:
-------------------------------------------+------------------------------

Comment (by kadamwhite):

 We ran into this one while upgrading a site to PHP 8 today, thank you
 @codesdnc for the clear ticket! It saved us a lot of time understanding
 why the feeds were failing.

 I paired up with @miguelaxcar to debug this and create the linked PR.

 I'm not certain whether there's a better way to set up the global
 `$wp_query` than in the unit test I added, but when we tried manipulating
 the global query directly the change didn't seem to trigger the error. We
 validated locally by setting `LOCAL_PHP=8.0-fpm` in our `.env` file when
 running unit tests.

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


More information about the wp-trac mailing list