Index: branches/REL1_17/phase3/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() { |
Index: branches/REL1_17/phase3/RELEASE-NOTES |
— | — | @@ -528,6 +528,8 @@ |
529 | 529 | * (bug 28306) Fix exposure of suppressed usernames in ForeignDBRepo |
530 | 530 | * (bug 28444) Fix regression: edit-on-doubleclick retains revision id again |
531 | 531 | * UtfNormal::cleanUp on an invalid utf-8 sequence no longer returns false if intl installed. |
| 532 | +* (bug 26729) Category pages should return 404 if they do not exist and have no |
| 533 | + members. |
532 | 534 | |
533 | 535 | === API changes in 1.17 === |
534 | 536 | * BREAKING CHANGE: action=patrol now requires POST |
Property changes on: branches/REL1_17/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
535 | 537 | Merged /trunk/phase3:r80406 |