Index: branches/category-redirects/includes/CategoryPage.php |
— | — | @@ -223,18 +223,18 @@ |
224 | 224 | $this->flip = false; |
225 | 225 | } |
226 | 226 | |
227 | | - # When displaying a category redirect, show only inline inclusions |
228 | | - $linkedFrom = $this->cat->getRedir() ? 'cl_inline' : 'cl_target' ; |
| 227 | + # When displaying a category redirect (with redirect=no) , show only inline inclusions |
| 228 | + $linkedFrom = $this->cat->getRedir() ? 'inline' : 'target' ; |
229 | 229 | |
230 | 230 | $res = $dbr->select( |
231 | 231 | array( 'page', 'categorylinks', 'category' ), |
232 | 232 | array( 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey', |
233 | 233 | 'cat_id', 'cat_redir', 'cat_title', 'cat_subcats', 'cat_pages', 'cat_files' ), |
234 | 234 | array( $pageCondition, |
235 | | - $linkedFrom => $this->cat->getID() ), |
| 235 | + 'cl_' . $linkedFrom => $this->cat->getID() ), |
236 | 236 | __METHOD__, |
237 | 237 | array( 'ORDER BY' => $this->flip ? 'cl_sortkey DESC' : 'cl_sortkey', |
238 | | - 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey_target' ), |
| 238 | + 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey_' . $linkedFrom ), |
239 | 239 | 'LIMIT' => $this->limit + 1 ), |
240 | 240 | array( 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ), |
241 | 241 | 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY ) ) ); |