Index: includes/CategoryPage.php =================================================================== --- includes/CategoryPage.php (revision 23171) +++ includes/CategoryPage.php (working copy) @@ -195,13 +195,26 @@ $pageCondition = '1 = 1'; $this->flip = false; } + + // Let's see if anything redirects here, and include redirected members as well + $titles = array($this->title->getDBKey()); $res = $dbr->select( + array('page', 'redirect'), + 'page_title', + array('page_id = rd_from', 'rd_title' => $this->title->getDBKey()), + __METHOD__ + ); + while($r = $dbr->fetchObject($res)) + $titles[] = $r->page_title; + + $res = $dbr->select( array( 'page', 'categorylinks' ), array( 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey' ), array( $pageCondition, 'cl_from = page_id', - 'cl_to' => $this->title->getDBKey()), + 'cl_to' => $titles, #'page_is_redirect' => 0), + ), #+ $pageCondition, __METHOD__, array( 'ORDER BY' => $this->flip ? 'cl_sortkey DESC' : 'cl_sortkey',