Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php |
— | — | @@ -270,13 +270,13 @@ |
271 | 271 | // so this can't ever work with uncategorized articles |
272 | 272 | $fields = array( 'page_namespace', 'page_title', 'page_id', 'c1.cl_timestamp' ); |
273 | 273 | $conditions = array(); |
| 274 | + $joins = array(); |
274 | 275 | |
275 | 276 | if ( $params['namespace'] !== false ) { |
276 | 277 | $conditions['page_namespace'] = $params['namespace']; |
277 | 278 | } |
278 | 279 | |
279 | | - $joins = array(); |
280 | | - wfRunHooks('GoogleNewsSitemap::Query', array($params, &$joins, &$conditions)); |
| 280 | + wfRunHooks('GoogleNewsSitemap::Query', array($params, &$joins, &$conditions, &$tables)); |
281 | 281 | |
282 | 282 | switch ( $params['redirects'] ) { |
283 | 283 | case self::OPT_ONLY: |
— | — | @@ -307,7 +307,6 @@ |
308 | 308 | $currentTableNumber = 1; |
309 | 309 | $categorylinks = $dbr->tableName( 'categorylinks' ); |
310 | 310 | |
311 | | - $joins = array(); |
312 | 311 | for ( $i = 0; $i < $params['catCount']; $i++ ) { |
313 | 312 | $joins["$categorylinks AS c$currentTableNumber"] = array( 'INNER JOIN', |
314 | 313 | array( "page_id = c{$currentTableNumber}.cl_from", |
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php |
— | — | @@ -1001,10 +1001,13 @@ |
1002 | 1002 | return false; // final |
1003 | 1003 | } |
1004 | 1004 | |
1005 | | - public static function gnsmQueryModifier( array $params, array &$joins, array &$conditions ) { |
1006 | | - $filterSet = array( GoogleNewsSitemap::OPT_ONLY, GoogleNewsSitemap::OPT_EXCLUDE ); |
| 1005 | + public static function gnsmQueryModifier( array $params, array &$joins, array &$conditions, array &$tables ) { |
| 1006 | + $filterSet = array( GoogleNewsSitemap::OPT_ONLY => true, |
| 1007 | + GoogleNewsSitemap::OPT_EXCLUDE => true |
| 1008 | + ); |
1007 | 1009 | # Either involves the same JOIN here... |
1008 | 1010 | if ( isset( $filterSet[ $params['stable'] ] ) || isset( $filterSet[ $params['quality'] ] ) ) { |
| 1011 | + $tables[] = 'flaggedpages'; |
1009 | 1012 | $joins['flaggedpages'] = array( 'LEFT JOIN', 'page_id = fp_page_id' ); |
1010 | 1013 | } |
1011 | 1014 | |
— | — | @@ -1022,7 +1025,7 @@ |
1023 | 1026 | $conditions[] = 'fp_quality >= 1'; |
1024 | 1027 | break; |
1025 | 1028 | case GoogleNewsSitemap::OPT_EXCLUDE: |
1026 | | - $conditions['fp_quality'] = 0; |
| 1029 | + $conditions[] = 'fp_quality = 0 OR fp_quality IS NULL'; |
1027 | 1030 | break; |
1028 | 1031 | } |
1029 | 1032 | |