[wp-trac] [WordPress Trac] #29718: Improved coverage for WP_Tax_Query unit tests

WordPress Trac noreply at wordpress.org
Thu Oct 16 21:11:49 UTC 2014


#29718: Improved coverage for WP_Tax_Query unit tests
------------------------------+---------------------------
 Reporter:  boonebgorges      |       Owner:  boonebgorges
     Type:  enhancement       |      Status:  reopened
 Priority:  normal            |   Milestone:  4.1
Component:  Taxonomy          |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+---------------------------

Comment (by nofearinc):

 While testing the latest trunk I and @mordauk got a Fatal Error on a theme
 running on my blog. Xdebug stack trace here said the following:

 {{{
 ( ! ) Fatal error: Cannot break/continue 1 level in
 /opt/lampp/htdocs/wpbleeding/wp-includes/taxonomy.php on line 1044
 Call Stack
 #       Time    Memory  Function        Location
 1       0.0001  329472  {main}( )       ../index.php:0
 2       0.0001  332584  require( '/opt/lampp/htdocs/wpbleeding/wp-blog-
 header.php' )    ../index.php:17
 3       0.3819  24099580        wp( )   ../wp-blog-header.php:14
 4       0.3819  24099652        WP->main( )     ../functions.php:873
 5       0.3848  24156160        WP->query_posts( )      ../class-
 wp.php:612
 6       0.3848  24156232        WP_Query->query( )      ../class-
 wp.php:541
 7       0.3849  24156832        WP_Query->get_posts( )  ../query.php:3843
 8       0.3885  24167100        WP_Tax_Query->get_sql( )
 ../query.php:2685
 9       0.3885  24167224        WP_Tax_Query->get_sql_clauses( )
 ../taxonomy.php:857
 10      0.3885  24167384        WP_Tax_Query->get_sql_for_query( )
 ../taxonomy.php:882
 11      0.3886  24168808        WP_Tax_Query->get_sql_for_clause( )
 ../taxonomy.php:933
 }}}

 The changeset here calls `continue;` in the new `get_sql_for_clause()`
 function, but no loop has been defined within the function. This seems to
 cause the fatal error on PHP 5.3.x (two different versions).

 That might as well work in 5.4 and above, but seems to be a blocker in
 earlier versions. We could probably avoid `continue;` by reversing the
 conditional as in the patch attachment.

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


More information about the wp-trac mailing list