Last modified: 2010-09-08 10:41:28 UTC
On displaying a category page that contains sub-categories, my site (running on svn trunk) shows the following fatal PHP error: Notice: Undefined variable: title in ./includes/CategoryPage.php on line 172 Fatal error: Call to a member function getPrefixedText() on a non-object in ./includes/CategoryPage.php on line 193 On examining the relevant function, the error seems immediately apparent: /** * Add a subcategory to the internal lists, using a Category object */ function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) { // Subcategory; strip the 'Category' namespace from the link text. $this->children[] = $this->getSkin()->link( $cat->getTitle(), null, array(), array(), array( 'known', 'noclasses' ) ); $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey ); } In the last line, the variable $title is used, when it hasn't been defined or passed as an argument. This should probably be replaced by $cat->getTitle(), as earlier in the function. Making that replacement fixed the error for me.
Fixed in r72576.