Index: branches/wmf/1.17wmf1/includes/CategoryPage.php |
— | — | @@ -44,14 +44,23 @@ |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * 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. |
48 | 50 | */ |
49 | 51 | function hasViewableContent() { |
50 | 52 | if ( parent::hasViewableContent() ) { |
51 | 53 | return true; |
52 | 54 | } else { |
53 | 55 | $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 | + } |
55 | 63 | } |
| 64 | + return false; |
56 | 65 | } |
57 | 66 | |
58 | 67 | function openShowCategory() { |
Property changes on: branches/wmf/1.17wmf1/includes/CategoryPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
59 | 68 | Merged /trunk/phase3/includes/CategoryPage.php:r80406 |
Property changes on: branches/wmf/1.17wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
60 | 69 | Merged /trunk/phase3:r80406 |