should return 404
Previously, a category returned 404, only if it had no content page,
had no members, and never had any members (aka there was no entry
in the category table for it).
As before, if you're editing the category page, its still considered a 200.
* (bug 10158) Do not mention allowing others to contact you when the feature
is disabled ($wgEnableUserEmail=false)
* (bug 26733) Wrap initial table creation in transaction
+* (bug 26729) Category pages should return 404 if they do not exist and have no
+ members.
=== API changes in 1.18 ===
* (bug 26339) Throw warning when truncating an overlarge API result
/**
* Don't return a 404 for categories in use.
+ * In use defined as: either the actual page exists
+ * or the category currently has members.
*/
function hasViewableContent() {
if ( parent::hasViewableContent() ) {
return true;
} else {
$cat = Category::newFromTitle( $this->mTitle );
- return $cat->getId() != 0;
+ // If any of these are not 0, then has members
+ if ( $cat->getPageCount()
+ || $cat->getSubcatCount()
+ || $cat->getFileCount()
+ ) {
+ return true;
+ }
}
+ return false;
}
function openShowCategory() {