r72388 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72387‎ | r72388 | r72389 >
Date:18:46, 4 September 2010
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
Follow up r36814. Make the deprecated function call the non-deprecated one instead of the other way around.
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -159,19 +159,10 @@
160160 /**
161161 * Add a subcategory to the internal lists, using a Category object
162162 */
163 - function addSubcategoryObject( $cat, $sortkey, $pageLength ) {
164 - $title = $cat->getTitle();
165 - $this->addSubcategory( $title, $sortkey, $pageLength );
166 - }
167 -
168 - /**
169 - * Add a subcategory to the internal lists, using a title object
170 - * @deprecated kept for compatibility, please use addSubcategoryObject instead
171 - */
172 - function addSubcategory( $title, $sortkey, $pageLength ) {
 163+ function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
173164 // Subcategory; strip the 'Category' namespace from the link text.
174165 $this->children[] = $this->getSkin()->link(
175 - $title,
 166+ $cat->getTitle(),
176167 null,
177168 array(),
178169 array(),
@@ -182,6 +173,14 @@
183174 }
184175
185176 /**
 177+ * Add a subcategory to the internal lists, using a title object
 178+ * @deprecated kept for compatibility, please use addSubcategoryObject instead
 179+ */
 180+ function addSubcategory( Title $title, $sortkey, $pageLength ) {
 181+ $this->addSubcategoryObject( Category::newFromTitle( $title ), $sortkey, $pageLength );
 182+ }
 183+
 184+ /**
186185 * Get the character to be used for sorting subcategories.
187186 * If there's a link from Category:A to Category:B, the sortkey of the resulting
188187 * entry in the categorylinks table is Category:A, not A, which it SHOULD be.

Follow-up revisions

RevisionCommit summaryAuthorDate
r72689Follow up r72388. Add the hint to the subclass, too.platonides22:35, 9 September 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36814Make member counts from the new category table available for subcategories, b...daniel14:06, 30 June 2008

Comments

#Comment by Raymond (talk | contribs)   11:32, 9 September 2010

Now I get:

Strict Standards: Declaration of CategoryTreeCategoryViewer::addSubcategoryObject() should be compatible with that of CategoryViewer::addSubcategoryObject() in D:\F_Programmierung\xampp\htdocs\wiki2\extensions\CategoryTree\CategoryPageSubclass.php on line 7

#Comment by Platonides (talk | contribs)   22:36, 9 September 2010

Good catch. That's in CategoryTree extension. Fixed in r72689.

Status & tagging log