diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-03-19 04:04:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-19 04:04:22 +0300 |
commit | f5d425c42c7b8db165fb7cbca34c6252ebb775ff (patch) | |
tree | 5e225ddd8d1e033c61bd349401db2234651e47a0 | |
parent | 94fa2b326b4bf6cea318c4e35f25d829d8b625d4 (diff) |
in segmented visitor log segment is already encoded, decode it again when adding as new (#14221)
* segment is already double encoded, decode it again
* Remove addSegmentAsNew after apply and save.
-rw-r--r-- | plugins/Live/javascripts/visitorLog.js | 2 | ||||
-rw-r--r-- | plugins/SegmentEditor/javascripts/Segmentation.js | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/Live/javascripts/visitorLog.js b/plugins/Live/javascripts/visitorLog.js index 5784504871..4b1e2e0835 100644 --- a/plugins/Live/javascripts/visitorLog.js +++ b/plugins/Live/javascripts/visitorLog.js @@ -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); diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index 1b8a11e34c..f406e37d05 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -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); } }; |