Example #1
0
 /**
  * Don't return a 404 for categories in use.
  */
 function hasViewableContent()
 {
     if (parent::hasViewableContent()) {
         return true;
     } else {
         $cat = Category::newFromTitle($this->mTitle);
         return $cat->getId() != 0;
     }
 }
Example #2
0
 /**
  * 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);
         // If any of these are not 0, then has members
         if ($cat->getPageCount() || $cat->getSubcatCount() || $cat->getFileCount()) {
             return true;
         }
     }
     return false;
 }
	/**
	 * Override Article::hasViewableContent() so that it doesn't return 404
	 * if the item page exists.
	 */
	public function hasViewableContent() {
		return parent::hasViewableContent() ||
			( $this->mItem !== null && $this->mItem->exists() );
	}