[wp-trac] [WordPress Trac] #12047: comment submitted on static front page causes unnecessary jump to blog page

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 29 23:41:25 UTC 2010


#12047: comment submitted on static front page causes unnecessary  jump to blog
page
--------------------------------+-------------------------------------------
 Reporter:  aritchie1           |        Owner:  ryan    
     Type:  defect (bug)        |       Status:  reopened
 Priority:  normal              |    Milestone:  3.0     
Component:  Query               |      Version:  2.9.1   
 Severity:  normal              |   Resolution:          
 Keywords:  front page comment  |  
--------------------------------+-------------------------------------------
Changes (by aaroncampbell):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 The [13493] revision caused a problem for me.  Basically, I'm doing a
 custom query like this on a page on my site:
 {{{
 $clients_query = new WP_Query();

 $args = array(
     'post_parent'   => $id,
     'post_type'             => 'page',
     'paged'                 => $paged,
     'posts_per_page'=> 5,
     'orderby'               => 'menu_order',
     'order'                 => 'ASC',
 );
 $clients_query->query($args);
 }}}

 Where $id is 245, a specific page ID that has child pages.

 Unfortunately that means that on lines 1473-1474 of wp-include/query.php
 is_home is set to true.  Then the newly re-written conditional here causes
 `$qv['page_id'] = get_option('page_on_front');` which means I get the
 front page instead of the sub pages I want.

 I fixed it for me by adding `( empty($this->query) || $qv['preview'] ==
 'true' )` back to the conditional.  Why exactly was that part removed?

 I'm attaching a patch that will put it back.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12047#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list