[Piwik-svn] r200 - in trunk: modules plugins/Home tests/modules

svnmaster at piwik.org svnmaster at piwik.org
Sat Jan 19 20:27:33 CET 2008


Author: matt
Date: 2008-01-19 20:27:33 +0100 (Sat, 19 Jan 2008)
New Revision: 200

Modified:
   trunk/modules/ViewDataTable.php
   trunk/plugins/Home/Controller.php
   trunk/tests/modules/Database.test.php
Log:
fixing bug exclude low population for actions table

Modified: trunk/modules/ViewDataTable.php
===================================================================
--- trunk/modules/ViewDataTable.php	2008-01-19 19:21:46 UTC (rev 199)
+++ trunk/modules/ViewDataTable.php	2008-01-19 19:27:33 UTC (rev 200)
@@ -355,17 +355,22 @@
 	}
 	
 	
-	public function setExcludeLowPopulation( $value = null )
+	public function setExcludeLowPopulation( $value = null, $columnId = null )
 	{
 		if( is_null( $value) ) 
 		{
 			throw new Exception("setExcludeLowPopulation() value shouldn't be null");
 		}
+		
+		if(is_null($columnId))
+		{
+			$columnId = Piwik_Archive::INDEX_NB_VISITS;
+		}
 		
 		// column to use to enable low population exclusion if != false
 		$this->variablesDefault['filter_excludelowpop_default'] 
 			= $this->variablesDefault['filter_excludelowpop']
-			= 2;
+			= $columnId;
 		
 		// the minimum value a row must have to be returned 
 		$this->variablesDefault['filter_excludelowpop_value_default'] 

Modified: trunk/plugins/Home/Controller.php
===================================================================
--- trunk/plugins/Home/Controller.php	2008-01-19 19:21:46 UTC (rev 199)
+++ trunk/plugins/Home/Controller.php	2008-01-19 19:27:33 UTC (rev 200)
@@ -188,7 +188,7 @@
 		$visitsInfo = $this->getVisitsSummary(); 
 		$nbActions = $visitsInfo->getColumn('nb_actions');
 		$nbActionsLowPopulationThreshold = floor(0.02 * $nbActions); // 2 percent of the total number of actions
-		$view->setExcludeLowPopulation( $nbActionsLowPopulationThreshold );
+		$view->setExcludeLowPopulation( $nbActionsLowPopulationThreshold, 'nb_hits' );
 		
 		$view->main();
 		
@@ -199,7 +199,7 @@
 //			var_dump($phpArrayRecursive);exit;
 			$view->view->arrayDataTable = $phpArrayRecursive;
 		}
-		
+//		var_dump( $view->view->arrayDataTable);exit;
 		return $view;
 	}
 	

Modified: trunk/tests/modules/Database.test.php
===================================================================
--- trunk/tests/modules/Database.test.php	2008-01-19 19:21:46 UTC (rev 199)
+++ trunk/tests/modules/Database.test.php	2008-01-19 19:27:33 UTC (rev 200)
@@ -139,7 +139,7 @@
 	function __construct( $title = '')
 	{
 		parent::__construct( $title );
-		print("For EVERY test the Database is created before and dropped at the end of the test method.<br>");
+		print("For EACH TEST the Database is created before and dropped at the end of the test method.<br>");
 	}
 	
 	public function setUp()



More information about the Piwik-svn mailing list