CMS MADE SIMPLE FORGE

Simple Tagging

 

[#3859] More than 5 page with same tag generate a PHP fatal error

avatar
Created By: blast blast (blast)
Date Submitted: Sat Aug 08 05:21:47 -0400 2009

Assigned To: Sofia Hauschildt (sonya)
Version: 0.2.1
CMSMS Version: None
Severity: Critical
Resolution: Fixed
State: Closed
Summary:
More than 5 page with same tag generate a PHP fatal error
Detailed Description:
I found that if you add more than 5 pages with same tag, simpletagging module
crash with this error:

... PHP Fatal error:  Call to a member function GetURL() on a non-object in
/var/www/vhosts/www.mysite.com/httpdocs/modules/simpletagging/action.related.php
on line 50 referer: http://.....

If number of pages with same tag is 4 all works fine.

Can you check?


History

Comments
avatar
Date: 2009-08-10 08:20
Posted By: blast blast (blast)

The problem is not the number of pages as described, but "Inactive" page with
tags. SQL query should be updated to prevent this problem.
      
avatar
Date: 2009-08-11 05:26
Posted By: blast blast (blast)

Here working patched code of file action.related.php

while ($result && !$result->EOF) 
{
	if ($result->fields['count'] < $mintags) {
		break;
	}
	$tmp = array();
	$curnode =& $hm->getNodeById($result->fields['page_id']);
  $curcontent = $curnode->getContent();
if (isset($curcontent) && $curcontent->Active() && $curcontent->ShowInMenu() )
{
  	$tmp[url] = $curcontent->GetURL();
  	$tmp[title] = $curcontent->mName;
  	$percentage = round(($result->fields['count'] / $tagcount) * 100);
  	$tmp[percentage] = $percentage;
  	array_push($related, $tmp);
	}	
	$result->moveNext();
}

      
avatar
Date: 2010-12-31 12:26
Posted By: Sofia Hauschildt (sonya)

Fixed in 0.3.1
      
Updates

Updated: 2010-12-31 12:26
resolution_id: 10 => 7
assigned_to_id: 6615 => 4617
state: Open => Closed

Updated: 2009-08-11 05:27
resolution_id: 5 => 10

Updated: 2009-08-10 08:20
resolution_id: => 5