From 1bf059cd33ddb4a42a89a84117a7342b5caab7e1 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 9 Mar 2011 01:13:17 +0000 Subject: [PATCH] Merge r83652 from 1.17wmf1 to trunk: add backwards compatibility from &from= and &until= on category pages to keep things like alphabet templates working --- includes/CategoryPage.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 5b96a1d84e..a8cae439de 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -70,10 +70,14 @@ class CategoryPage extends Article { function closeShowCategory() { global $wgOut, $wgRequest; + // Use these as defaults for back compat --catrope + $oldFrom = $wgRequest->getVal( 'from' ); + $oldUntil = $wgRequest->getVal( 'until' ); + $from = $until = array(); foreach ( array( 'page', 'subcat', 'file' ) as $type ) { - $from[$type] = $wgRequest->getVal( "{$type}from" ); - $until[$type] = $wgRequest->getVal( "{$type}until" ); + $from[$type] = $wgRequest->getVal( "{$type}from", $oldFrom ); + $until[$type] = $wgRequest->getVal( "{$type}until", $oldUntil ); } $viewer = new $this->mCategoryViewerClass( $this->mTitle, $from, $until, $wgRequest->getValues() ); @@ -344,7 +348,7 @@ class CategoryViewer { array( 'page_id', 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title', 'cat_subcats', 'cat_pages', 'cat_files', 'cl_sortkey_prefix' ), - array( 'cl_to' => $this->title->getDBkey() ) + $extraConds, + array_merge( array( 'cl_to' => $this->title->getDBkey() ), $extraConds ), __METHOD__, array( 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ), -- 2.20.1