r86988 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86987‎ | r86988 | r86989 >
Date:21:19, 26 April 2011
Author:reedy
Status:ok
Tags:
Comment:
MFT r80406
Modified paths:
  • /branches/wmf/1.17wmf1 (modified) (history)
  • /branches/wmf/1.17wmf1/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/CategoryPage.php
@@ -44,14 +44,23 @@
4545
4646 /**
4747 * Don't return a 404 for categories in use.
 48+ * In use defined as: either the actual page exists
 49+ * or the category currently has members.
4850 */
4951 function hasViewableContent() {
5052 if ( parent::hasViewableContent() ) {
5153 return true;
5254 } else {
5355 $cat = Category::newFromTitle( $this->mTitle );
54 - return $cat->getId() != 0;
 56+ // If any of these are not 0, then has members
 57+ if ( $cat->getPageCount()
 58+ || $cat->getSubcatCount()
 59+ || $cat->getFileCount()
 60+ ) {
 61+ return true;
 62+ }
5563 }
 64+ return false;
5665 }
5766
5867 function openShowCategory() {
Property changes on: branches/wmf/1.17wmf1/includes/CategoryPage.php
___________________________________________________________________
Modified: svn:mergeinfo
5968 Merged /trunk/phase3/includes/CategoryPage.php:r80406
Property changes on: branches/wmf/1.17wmf1
___________________________________________________________________
Modified: svn:mergeinfo
6069 Merged /trunk/phase3:r80406

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80406(bug 26729) Categories that do not have a page, and have no members,...bawolff21:59, 15 January 2011

Status & tagging log