Opened 2 years ago

Closed 2 years ago

#2801 closed Bug (fixed)

segment breaks sparklines in VisitsSummary

Reported by: thenumbercoder Owned by:
Priority: normal Milestone: 1.7 Piwik 1.7
Component: Core Keywords: segment, sparklines,
Cc: Sensitive: no

Description

VisitsSummary module's action 'getSparklines' has broken images when using a segment in the URL params. Instead of sparklines, broken images appear.
E.g.: http://demo.piwik.org/index.php?module=VisitsSummary&action=getSparklines&idSite=3&period=month&date=2011-11-24&disableLink=1&segment=country==DE,country==US&token_auth=e559d132f5eda5d8c2d3ce037cfd99a7
Good news! I fixed it locally, and will be submitting a patch soon. It was only a 3-line

fix: reaplce lines Piwik_Common, lines 390-392 "$exploded = explode('=',$value);
$name = $exploded[0];
$value = $exploded[1];

with

$locationOfSeperator=strpos($value,'=');
$name=substr($value,0,$locationOfSeperator);
$value=substr($value,$locationOfSeperator+1);

The problem was normally the inputted value is just a key=value string, but for segments its key=subkey==value, so exploding on '=' broke lost everything after the second '='.

Attachments (1)

Screen shot 2011-11-25 at 1.26.10 PM.png (136.2 KB) - added by thenumbercoder 2 years ago.

Download all attachments as: .zip

Change History (3)

Changed 2 years ago by thenumbercoder

comment:1 Changed 2 years ago by matt (mattab)

  • Milestone set to 1.7 Piwik 1.7
  • Priority changed from low to normal

Thanks for report and patch!

comment:2 Changed 2 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [5483]) fixes #2801

Note: See TracTickets for help on using tickets.