Skip to:
Content

bbPress.org

Changeset 6434


Ignore:
Timestamp:
05/26/2017 10:14:20 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Queries: Update orderby clauses of last-id queries to ensure more accurate results, specifically for imported forums and posts where IDs and post_date columns might be inverted.

Also update a few tests to be less cranky with exact array results.

Props thebrandonallen. Fixes #3108.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/functions.php

    r6432 r6434  
    15001500        'post_status' => $post_status,
    15011501        'post_type'   => $post_type,
     1502        'orderby'     => array(
     1503            'post_date' => 'DESC',
     1504            'ID'        => 'DESC'
     1505        ),
    15021506
    15031507        // Maybe change these later
  • trunk/src/includes/forums/functions.php

    r6430 r6434  
    21662166                $types['meta_query'] = array(
    21672167                    'key'     => '_bbp_forum_id',
    2168                     'value'   => $forum_ids,
     2168                    'value'   => $types['string'],
    21692169                    'type'    => 'NUMERIC',
    21702170                    'compare' => $compare
     
    23582358        'post_status'     => bbp_get_public_status_id(),
    23592359        'post_type'       => bbp_get_reply_post_type(),
     2360        'orderby'         => array(
     2361            'post_date' => 'DESC',
     2362            'ID'        => 'DESC'
     2363        ),
    23602364
    23612365        // Maybe change these later
  • trunk/tests/phpunit/testcases/topics/functions/status.php

    r5931 r6434  
    148148
    149149        $topic_meta_pre_spammed_replies = get_post_meta( $t, '_bbp_pre_spammed_replies', true );
    150         $this->assertEquals( array( $r[1], $r[0] ), $topic_meta_pre_spammed_replies );
     150        $this->assertEqualSets( array( $r[1], $r[0] ), $topic_meta_pre_spammed_replies );
    151151
    152152        $topic_spam_meta_status = get_post_meta( $t, '_bbp_spam_meta_status', true );
     
    215215
    216216        $topic_meta_pre_spammed_replies = get_post_meta( $t, '_bbp_pre_spammed_replies', true );
    217         $this->assertEquals( array( $r[1], $r[0] ), $topic_meta_pre_spammed_replies );
     217        $this->assertEqualSets( array( $r[1], $r[0] ), $topic_meta_pre_spammed_replies );
    218218
    219219        foreach ( $r as $reply ) {
Note: See TracChangeset for help on using the changeset viewer.