Skip to content

Commit

Permalink
Refs #3934 much better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed May 23, 2013
1 parent 3032245 commit a930ce4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions core/ReportRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,22 +218,21 @@ protected static function processTableFormat($reportMetadata, $report, $reportCo

public static function getStaticGraph($reportMetadata, $width, $height, $evolution, $segment)
{

$imageGraphUrl = $reportMetadata['imageGraphUrl'];

if ($evolution && !empty($reportMetadata['imageGraphEvolutionUrl'])) {
$imageGraphUrl = $reportMetadata['imageGraphEvolutionUrl'];
}

$request = new Piwik_API_Request(
$imageGraphUrl .
$requestGraph = $imageGraphUrl .
'&outputType=' . Piwik_ImageGraph_API::GRAPH_OUTPUT_PHP .
'&format=original&serialize=0' .
'&filter_truncate=' .
'&width=' . $width .
'&height=' . $height .
($segment != null ? '&segment=' . $segment['definition'] : '')
);
($segment != null ? '&segment=' . urlencode($segment['definition']) : '');

$request = new Piwik_API_Request($requestGraph);

try {
$imageGraph = $request->process();
Expand Down
3 changes: 1 addition & 2 deletions plugins/API/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ public function getProcessedReport($idSite, $period, $date, $apiModule, $apiActi
'idSubtable' => $idSubtable,
));
if (!empty($segment)) $parameters['segment'] = $segment;
$parameters = array_map('urlencode', $parameters);

$url = Piwik_Url::getQueryStringFromParameters($parameters);
$request = new Piwik_API_Request($url);
Expand Down Expand Up @@ -1153,7 +1152,7 @@ private function mergeDataTables($table1, $table2)
public function getRowEvolution($idSite, $period, $date, $apiModule, $apiAction, $label = false, $segment = false, $column = false, $language = false, $idGoal = false, $legendAppendMetric = true, $labelUseAbsoluteUrl = true)
{
// validation of requested $period & $date
if ($period == 'range') {
if ($period == 'range') {
// load days in the range
$period = 'day';
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/PDFReports/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function generateReport($idReport, $date, $language = false, $outputType

$processedReport = Piwik_API_API::getInstance()->getProcessedReport(
$idSite, $period, $date, $apiModule, $apiAction,
$segment != null ? $segment['definition'] : false,
$segment != null ? urlencode($segment['definition']) : false,
$apiParameters, $idGoal = false, $language
);

Expand Down

0 comments on commit a930ce4

Please sign in to comment.