Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -621,14 +621,7 @@ |
622 | 622 | $return = ""; |
623 | 623 | $name = $imageTitle->getDBkey(); |
624 | 624 | $count = $image->pageCount(); |
625 | | - $dbr = wfGetDB( DB_SLAVE ); |
626 | | - $pagetable = $dbr->tableName( 'page' ); |
627 | 625 | |
628 | | - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) ); |
629 | | - if ( $page_ns_index == NULL ) { |
630 | | - $page_ns_index = NS_MAIN; |
631 | | - } |
632 | | - |
633 | 626 | $from = $args['from']; |
634 | 627 | $to = $args['to']; |
635 | 628 | if( !$from ) $from = 1; |
— | — | @@ -1056,6 +1049,11 @@ |
1057 | 1050 | function pr_update_pr_index( $index, $deletedpage=null ) { |
1058 | 1051 | global $pr_page_namespace, $pr_index_namespace; |
1059 | 1052 | |
| 1053 | + $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) ); |
| 1054 | + if ( $page_ns_index == NULL ) { |
| 1055 | + return; |
| 1056 | + } |
| 1057 | + |
1060 | 1058 | $index_title = $index->mTitle; |
1061 | 1059 | $index_id = $index->getID(); |
1062 | 1060 | |
— | — | @@ -1087,7 +1085,6 @@ |
1088 | 1086 | $catlinks = $dbr->tableName( 'categorylinks' ); |
1089 | 1087 | $page = $dbr->tableName( 'page' ); |
1090 | 1088 | $pagelist = "'".implode( "', '", $pages)."'"; |
1091 | | - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) ); |
1092 | 1089 | $query = "SELECT COUNT(page_id) AS count FROM $page LEFT JOIN $catlinks ON cl_from=page_id WHERE cl_to='###' AND page_namespace=$page_ns_index AND page_title IN ( $pagelist )" ; |
1093 | 1090 | |
1094 | 1091 | $q0 = str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality0_category' ) ); |