Difference between revisions of "Issue:Mode=category"

From FollowTheScore
Jump to: navigation, search
(Created page with "{{Issue |Type = Bug | Change Request <-- please select |Extension = DPL | Wgraph | aiSee | Call <-- please select |Version = 1.8.9 |Description = mode=category...")
 
m (Problem)
 
Line 19: Line 19:
 
     function formatCategoryList($iStart, $iCount) {
 
     function formatCategoryList($iStart, $iCount) {
 
 
    for($i = $iStart; $i < $iStart + $iCount; $i++) {
+
                for($i = $iStart; $i < $iStart + $iCount; $i++) {
 
$aArticles[] = $this->mArticles[$i]->mLink;
 
$aArticles[] = $this->mArticles[$i]->mLink;
 
$aArticles_start_char[] = $this->mArticles[$i]->mStartChar;
 
$aArticles_start_char[] = $this->mArticles[$i]->mStartChar;

Latest revision as of 14:10, 21 October 2011

Description: mode=category, CategoryPage.php is included, but file cannot be found.
Extension / Version: DPL   /   1.8.9
Type / Status: Bug   /   open

Problem

Error: The file CategoryPage,php included at DPL.php line 1216 cannot be found.

  • It works when i copied the file to the DPL extension folder.

not very clean. couldn't fix it with relative path,

Then an error occurs when no results, "$aArticles not defined".

  • I fixed that by putting the whole lot in an if ($iCount>0) statement.

Maybe nicer with an isset statement. Anyway, i have it working now.

    function formatCategoryList($iStart, $iCount) {
		
                for($i = $iStart; $i < $iStart + $iCount; $i++) {
			$aArticles[] = $this->mArticles[$i]->mLink;
			$aArticles_start_char[] = $this->mArticles[$i]->mStartChar;
			$this->filteredCount = $this->filteredCount + 1;
		}
		if ($iCount>0) {
		  require_once ('CategoryPage.php');
		  if ( count ( $aArticles ) > ExtDynamicPageList::$categoryStyleListCutoff ) {
			 return "__NOTOC____NOEDITSECTION__".CategoryViewer::columnList( $aArticles, $aArticles_start_char );
		  } elseif ( count($aArticles) > 0) {
			 // for short lists of articles in categories.
			 return "__NOTOC____NOEDITSECTION__".CategoryViewer::shortList( $aArticles, $aArticles_start_char );
		  }
		}
		return '';
	}


Reply