WordPress.org

Making WordPress.org

Changeset 926


Ignore:
Timestamp:
10/21/2014 11:25:21 PM (7 years ago)
Author:
nacin
Message:

Credits: Proper fix for #664. The tables are in separate databases, can't join them. The path restriction is because team P2s do/will exist. see #664.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/credits/wp-credits.php

    r925 r926  
    9696        $cache_key = array(
    9797            'translators' => 'translators-' . $gp_locale->slug . '-' . $this->version . '-' . $path,
    98             'validators'  => 'validators-' . $gp_locale->slug . '-' . $this->version . '-changed-1',
     98            'validators'  => 'validators-' . $gp_locale->slug . '-' . $this->version . '-changed-2',
    9999        );
    100100
     
    191191    protected function grab_validators( $gp_locale ) {
    192192        global $wpdb;
    193         $blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM wporg_blogs INNER JOIN locales ON wporg_blogs.domain = CONCAT(locales.subdomain, '.wordpress.org') WHERE locales.locale = %s", $gp_locale->wp_locale ) );
     193        $subdomain = $wpdb->get_var( $wpdb->prepare( "SELECT subdomain FROM locales WHERE locale = %s", $gp_locale->wp_locale ) );
     194        $blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM wporg_blogs WHERE domain = %s AND path = '/'", "$subdomain.wordpress.org" ) );
    194195        if ( $blog_id ) {
    195196            $meta_key = 'wporg_' . intval( $blog_id ) . '_capabilities';
Note: See TracChangeset for help on using the changeset viewer.