[Piwik-svn] r190 - in trunk: config modules/DataTable/Filter modules/ViewDataTable plugins plugins/Home tests/modules

svnmaster at piwik.org svnmaster at piwik.org
Fri Jan 18 17:16:22 CET 2008


Author: matt
Date: 2008-01-18 17:16:22 +0100 (Fri, 18 Jan 2008)
New Revision: 190

Modified:
   trunk/config/global.ini.php
   trunk/modules/DataTable/Filter/Sort.php
   trunk/modules/ViewDataTable/Html.php
   trunk/plugins/Actions.php
   trunk/plugins/Home/Controller.php
   trunk/tests/modules/PHP_Related.test.php
Log:
Took me one hour to find this bug!!! holy shit

Modified: trunk/config/global.ini.php
===================================================================
--- trunk/config/global.ini.php	2008-01-18 15:16:06 UTC (rev 189)
+++ trunk/config/global.ini.php	2008-01-18 16:16:22 UTC (rev 190)
@@ -48,7 +48,7 @@
 [Debug]
 ; if set to true, the archiving process will always be triggered, even if the archive has already been computed
 ; this is useful when making changes to the archiving code so we can 
-always_archive_data = false
+always_archive_data = true
 
 [General]
 ; Time in seconds after which an archive will be computed again. 
@@ -66,7 +66,8 @@
 ; default number of elements in the datatable
 dataTable_default_limit = 10
 
-minimum_php_version = 5.1
+; minimum required version (minimum requirement know to date = ->newInstanceArgs)
+minimum_php_version = 5.1.3
 
 minimum_memory_limit = 128
 

Modified: trunk/modules/DataTable/Filter/Sort.php
===================================================================
--- trunk/modules/DataTable/Filter/Sort.php	2008-01-18 15:16:06 UTC (rev 189)
+++ trunk/modules/DataTable/Filter/Sort.php	2008-01-18 16:16:22 UTC (rev 190)
@@ -24,12 +24,12 @@
 	{
 		parent::__construct($table);
 		
-		
 		// hack... But I can't see how to do properly
-		if($columnToSort == 0)
+		if($columnToSort == '0')
 		{
 			$columnToSort = 'label';
 		}
+		
 		$this->columnToSort = $columnToSort;
 		$this->naturalSort = $naturalSort;
 		$this->setOrder($order);

Modified: trunk/modules/ViewDataTable/Html.php
===================================================================
--- trunk/modules/ViewDataTable/Html.php	2008-01-18 15:16:06 UTC (rev 189)
+++ trunk/modules/ViewDataTable/Html.php	2008-01-18 16:16:22 UTC (rev 190)
@@ -78,7 +78,8 @@
 	}
 
 	protected function getPHPArrayFromDataTable( )
-	{
+	{
+		
 		$renderer = Piwik_DataTable_Renderer::factory('php');
 		$renderer->setTable($this->dataTable);
 		$renderer->setSerialize( false );

Modified: trunk/plugins/Actions.php
===================================================================
--- trunk/plugins/Actions.php	2008-01-18 15:16:06 UTC (rev 189)
+++ trunk/plugins/Actions.php	2008-01-18 16:16:22 UTC (rev 190)
@@ -105,7 +105,7 @@
 							LEFT JOIN ".$archiveProcessing->logActionTable." USING (idaction)
 				 	WHERE visit_server_date = ?
 				 		AND idsite = ?
-				 	GROUP BY idaction ";
+				 	GROUP BY idaction";
 		$query = $archiveProcessing->db->query($query, array( $archiveProcessing->strDateStart, $archiveProcessing->idsite ));
 				
 		$modified = $this->updateActionsTableWithRowQuery($query);

Modified: trunk/plugins/Home/Controller.php
===================================================================
--- trunk/plugins/Home/Controller.php	2008-01-18 15:16:06 UTC (rev 189)
+++ trunk/plugins/Home/Controller.php	2008-01-18 16:16:22 UTC (rev 190)
@@ -172,6 +172,9 @@
 			$view->setTemplate('Home/templates/datatable_actions_recursive.tpl');
 		}
 		$view->disableSort();
+		
+		$view->setSortedColumn( 'nb_hits', 'desc' );
+		
 		$view->disableOffsetInformation();
 		
 		$view->setColumnsToDisplay( array(0,1,2) );
@@ -184,6 +187,7 @@
 		$view->setExcludeLowPopulation( $nbActionsLowPopulationThreshold );
 		
 		$view->main();
+		
 		// we need to rewrite the phpArray so it contains all the recursive arrays
 		if($currentlySearching)
 		{

Modified: trunk/tests/modules/PHP_Related.test.php
===================================================================
--- trunk/tests/modules/PHP_Related.test.php	2008-01-18 15:16:06 UTC (rev 189)
+++ trunk/tests/modules/PHP_Related.test.php	2008-01-18 16:16:22 UTC (rev 190)
@@ -27,6 +27,14 @@
 	function test_TMP()
 	{
 		echo md5('root'.md5('nintendo'));
+	}
+	
+	public function testStringEqualszero()
+	{
+		$columnToSort = 'nb_hits';
+		// it might seem strange. This was the reason of a bug I searched 1 hour for!!
+		$this->assertTrue( $columnToSort == 0);
+		
 	}
 	
 	public function testMergeArray()



More information about the Piwik-svn mailing list