From 07ab72b8aa69bffa92e3cac7eead69eb8da290e7 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 13 Aug 2010 22:07:48 +0000 Subject: [PATCH] Fix extensions to work with category sort changes Three different extensions were copy-pasting all of CategoryPage::closeShowCategory() just to change which CategoryViewer descendant was used. I changed the base class to use a member variable for the CategoryViewer class, so this reduces code duplication too. I only tested this on CategoryTree; MetavidWiki is certainly still broken, from the looks of it (assumes $this->from is a string), but PeopleCategories might be okay. Hard to avoid breaking extensions with this sort of schema/index change. --- CategoryPageSubclass.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/CategoryPageSubclass.php b/CategoryPageSubclass.php index 7587af44..96846014 100644 --- a/CategoryPageSubclass.php +++ b/CategoryPageSubclass.php @@ -1,15 +1,7 @@ getVal( 'from' ); - $until = $wgRequest->getVal( 'until' ); - - $viewer = new CategoryTreeCategoryViewer( $this->mTitle, $from, $until ); - $wgOut->addHTML( $viewer->getHTML() ); - } + protected $mCategoryViewerClass = 'CategoryTreeCategoryViewer'; } class CategoryTreeCategoryViewer extends CategoryViewer {