Make WordPress Core

Changeset 25590


Ignore:
Timestamp:
09/24/2013 01:19:27 AM (11 years ago)
Author:
nacin
Message:

Revert [25446] now that wp_blogs.archived is no longer an ENUM field. see #14511.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r25488 r25590  
    20432043
    20442044    if ( isset( $args['archived'] ) )
    2045         $query .= $wpdb->prepare( "AND archived = %s ", (int) $args['archived'] ); // ENUM field
     2045        $query .= $wpdb->prepare( "AND archived = %d ", $args['archived'] );
    20462046
    20472047    if ( isset( $args['mature'] ) )
  • trunk/tests/phpunit/tests/ms.php

    r25488 r25590  
    10901090        $this->assertCount( 0, wp_get_sites( array( 'offset' => 20 ) ) );
    10911091    }
    1092 
    1093     /**
    1094      * Test the 'archived' argument for wp_get_sites().
    1095      *
    1096      * archived is an ENUM, not an integer field.
    1097      * ENUM('0', '1') means '0' is index 1 and '1' is index 2.
    1098      * `WHERE archived = 1` is like saying `WHERE archived = '0'`.
    1099      * `WHERE archived = 0` would produce no results.
    1100      *
    1101      * @ticket 14511
    1102      */
    1103     function test_wp_get_sites_archived_enum() {
    1104         global $wpdb;
    1105         $id = $this->factory->blog->create( array( 'site_id' => 2, 'meta' => array( 'archived' => '1' ) ) );
    1106         $this->factory->blog->create(       array( 'site_id' => 2, 'meta' => array( 'archived' => '0' ) ) );
    1107         $results = wp_get_sites( array( 'network_id' => 2, 'archived' => 1 ) );
    1108         $this->assertCount( 1, $results );
    1109         $this->assertEquals( $id, $results[0]['blog_id'], "This query is wrong:\n" . $wpdb->last_query );
    1110     }
    11111092}
    11121093
Note: See TracChangeset for help on using the changeset viewer.