Skip to content

Commit

Permalink
in segmented visitor log segment is already encoded, decode it again …
Browse files Browse the repository at this point in the history
…when adding as new (matomo-org#14221)

* segment is already double encoded, decode it again

* Remove addSegmentAsNew after apply and save.
  • Loading branch information
diosmosis committed Mar 19, 2019
1 parent 94fa2b3 commit f5d425c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/Live/javascripts/visitorLog.js
Expand Up @@ -53,7 +53,7 @@
e.stopPropagation();

var url = window.location.href;
url = broadcast.updateParamValue('addSegmentAsNew=' + self.param.segment, url);
url = broadcast.updateParamValue('addSegmentAsNew=' + decodeURIComponent(self.param.segment), url);
url = broadcast.updateParamValue('segment=', url);
url = broadcast.updateParamValue('popover=', url);

Expand Down
6 changes: 3 additions & 3 deletions plugins/SegmentEditor/javascripts/Segmentation.js
Expand Up @@ -854,12 +854,12 @@ $(document).ready(function() {

this.forceSegmentReload = function (segmentDefinition) {
segmentDefinition = this.uriEncodeSegmentDefinition(segmentDefinition);

if (piwikHelper.isAngularRenderingThePage()) {
return broadcast.propagateNewPage('', true, 'segment=' + segmentDefinition);
return broadcast.propagateNewPage('', true, 'addSegmentAsNew=&segment=' + segmentDefinition);
} else {
// eg in case of exported dashboard
return broadcast.propagateNewPage('segment=' + segmentDefinition, true, 'segment=' + segmentDefinition);
return broadcast.propagateNewPage('segment=' + segmentDefinition, true, 'addSegmentAsNew=&segment=' + segmentDefinition);
}
};

Expand Down

0 comments on commit f5d425c

Please sign in to comment.