Skip to content

Commit

Permalink
Fixes #3887
Browse files Browse the repository at this point in the history
Proper fix for this problem, adding static array of "Row evolution not supported"

Also I decided to enable tests so they all run on my box /standard ubuntu, rather than travis CI.
Fixed a bug in tests that plugins language files were not loaded early enough.
  • Loading branch information
mattab committed May 25, 2013
1 parent 848940a commit 70b46ec
Show file tree
Hide file tree
Showing 12 changed files with 1,684 additions and 1,680 deletions.
2 changes: 1 addition & 1 deletion plugins/API/API.php
Expand Up @@ -1035,8 +1035,8 @@ private function sort($a, $b)
Piwik_Translate('Referers_Referers'),
Piwik_Translate('Goals_Goals'),
Piwik_Translate('General_Visitors'),
Piwik_Translate('UserSettings_VisitorSettings'),
Piwik_Translate('DevicesDetection_DevicesDetection'),
Piwik_Translate('UserSettings_VisitorSettings'),
);
}
return ($category = strcmp(array_search($a['category'], $order), array_search($b['category'], $order))) == 0
Expand Down
12 changes: 11 additions & 1 deletion plugins/ImageGraph/ImageGraph.php
Expand Up @@ -15,6 +15,11 @@ class Piwik_ImageGraph extends Piwik_Plugin
'Referers_getRefererType',
);

// row evolution support not yet implemented for these APIs
static private $REPORTS_DISABLED_EVOLUTION_GRAPH = array(
'Referers_getAll',
);

public function getInformation()
{
return array(
Expand Down Expand Up @@ -130,7 +135,12 @@ public function getReportMetadata($notification)
// thanks to API.getRowEvolution, reports with dimensions can now be plotted using an evolution graph
// however, most reports with a fixed set of dimension values are excluded
// this is done so Piwik Mobile and Scheduled Reports do not display them
if (empty($report['constantRowsCount']) || in_array($reportUniqueId, self::$CONSTANT_ROW_COUNT_REPORT_EXCEPTIONS)) {
$reportWithDimensionsSupportsEvolution = empty($report['constantRowsCount']) || in_array($reportUniqueId, self::$CONSTANT_ROW_COUNT_REPORT_EXCEPTIONS);

$reportSupportsEvolution = !in_array($reportUniqueId, self::$REPORTS_DISABLED_EVOLUTION_GRAPH);

if ( $reportSupportsEvolution
&& $reportWithDimensionsSupportsEvolution) {
$parameters['period'] = $periodForMultiplePeriodGraph;
$parameters['date'] = $dateForMultiplePeriodGraph;
$report['imageGraphEvolutionUrl'] = $urlPrefix . Piwik_Url::getQueryStringFromParameters($parameters);
Expand Down
1 change: 0 additions & 1 deletion plugins/Referers/Referers.php
Expand Up @@ -80,7 +80,6 @@ public function getReportMetadata($notification)
'module' => 'Referers',
'action' => 'getAll',
'dimension' => Piwik_Translate('Referers_Referrer'),
'constantRowsCount' => true,
'documentation' => Piwik_Translate('Referers_AllReferersReportDocumentation', '<br />'),
'order' => 2,
),
Expand Down
11 changes: 4 additions & 7 deletions tests/PHPUnit/BaseFixture.php
Expand Up @@ -23,8 +23,8 @@
abstract class Test_Piwik_BaseFixture extends PHPUnit_Framework_Assert
{
const IMAGES_GENERATED_ONLY_FOR_OS = 'linux';
const IMAGES_GENERATED_FOR_PHP = '5.3.10';
const IMAGES_GENERATED_FOR_GD = '2.0';
const IMAGES_GENERATED_FOR_PHP = '5.4';
const IMAGES_GENERATED_FOR_GD = '2.0.36';

/** Adds data to Piwik. Creates sites, tracks visits, imports log files, etc. */
public abstract function setUp();
Expand Down Expand Up @@ -270,17 +270,14 @@ public static function setUpScheduledReports($idSite)
}

/**
* Return true if system under test has the following characteristics :
* - php_uname() contains 'precise32' or 'ubuntu'
* - phpversion() contains '5.3.10'
* - 'GD Version' equals '2.0'
* Return true if system under test has Piwik core team's most common configuration
*/
public static function canImagesBeIncludedInScheduledReports()
{
$gdInfo = gd_info();
return
stristr(php_uname(), self::IMAGES_GENERATED_ONLY_FOR_OS) &&
version_compare(phpversion(), self::IMAGES_GENERATED_FOR_PHP, '>=') &&
strpos( phpversion(), self::IMAGES_GENERATED_FOR_PHP) !== false &&
$gdInfo['GD Version'] == self::IMAGES_GENERATED_FOR_GD;
}

Expand Down

Large diffs are not rendered by default.

0 comments on commit 70b46ec

Please sign in to comment.