Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[#3317] export_as_image_icon setting has no effect on widget #8

Closed
wants to merge 1 commit into from

2 participants

@chmielot

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Tests pass: -
Fixes the following tickets: #3317
Todo: -
License of the code: MIT

Use case:

Using Widgetize-Plugin to display certain widgets on a website:

<div id="widgetIframe">
<iframe width="100%" 
    height="350" 
    src="http://host/piwik/index.php?module=Widgetize&action=iframe&columns[]=nb_visits,nb_pageviews&moduleToWidgetize=VisitsSummary&actionToWidgetize=getEvolutionGraph&idSite=1&period=month&date=today&disableLink=1&widget=1&show_export_as_image_icon=0" 
    scrolling="no" 
    frameborder="0" 
    marginheight="0" 
    marginwidth="0" 
    id="visitssum"></iframe>
</div>

The show_export_as_image_icon setting has no effect, because the value (first set in parent class from request parameters) is overwritten in core/ViewDataTable/GenerateGraphHTML.php

I don't see why this shouldn't be allowed here. The patch fixes this problem.

@robocoder robocoder closed this
This was referenced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 23, 2012
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/ViewDataTable/GenerateGraphHTML.php
View
6 core/ViewDataTable/GenerateGraphHTML.php
@@ -68,7 +68,11 @@ function init($currentControllerName,
public function enableShowExportAsImageIcon()
{
- $this->viewProperties['show_export_as_image_icon'] = true;
+ // If user passed 0 or 1 in request, value is not overwritten. false is default
+ if (false === $this->viewProperties['show_export_as_image_icon'])
+ {
+ $this->viewProperties['show_export_as_image_icon'] = true;
+ }
}
public function addRowEvolutionSeriesToggle($initiallyShowAllMetrics) {
Something went wrong with that request. Please try again.