Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript error in some cases when applying a custom segment #10658

Closed
mattab opened this issue Oct 3, 2016 · 1 comment · Fixed by #10659
Closed

JavaScript error in some cases when applying a custom segment #10658

mattab opened this issue Oct 3, 2016 · 1 comment · Fixed by #10659
Assignees
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Oct 3, 2016

Reproduce:

  • Go to https://demo3.piwik.org/index.php?module=CoreHome&action=index&idSite=1&period=range&date=last30#?idSite=1&period=range&date=last30&category=General_Visitors&subcategory=Live_VisitorLog&segment=visitDuration%253D%253D10%252CcontinentCode!%253Deur%252CcustomVariablePageValue1!%253Dxlkagae%253BvisitId!%253D%252527%252522%252522%25253A%25257D%25257B%25255D%25255B%25255C%252527%25253B%25252F..%25252C%25253C%25253E%252CvisitDuration!%253D1'%252522
  • Click on Segment editor > Edit button for the segment matt weird chars edit on chrome
  • in the segment editor appends a character to one of the values, for example append x to Continent is not eurxx
  • click red button to apply segment
  • Expected: no error
  • Got JS error:
rror: Syntax error, unrecognized expression: div.segmentList ul li[data-definition="visitDuration==10,continentCode!=eurs,customVariablePageValue1!=xlkagae;visitId!='"":}{][\';/..,<>,visitDuration!=1'""]
    at Function.fa.error (jquery.min.js?cb=242d776…:2)
    at fa.tokenize (jquery.min.js?cb=242d776…:2)
    at Function.fa [as find] (jquery.min.js?cb=242d776…:2)
    at n.find (jquery.min.js?cb=242d776…:2)
    at n.fn.init (jquery.min.js?cb=242d776…:2)
    at n (jquery.min.js?cb=242d776…:2)
    at segmentation.markCurrentSegment (Segmentation.js?cb=242d776…:96)
    at segmentation.config.initHtml (Segmentation.js?cb=242d776…:1210)
    at Segmentation.js?cb=242d776…:1231
    at n.$broadcast (angular.js:16682)(anonymous function) @ angular.js:12783v.$get @ angular.js:9535$broadcast @ angular.js:16684k @ angular.js:12627(anonymous function) @ angular.js:12613$eval @ angular.js:16359$digest @ angular.js:16175$apply @ angular.js:16467(anonymous function) @ Segmentation.js?cb=242d776…:1283
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 3, 2016
@mattab mattab added this to the 3.0.0-b1 milestone Oct 3, 2016
@mattab mattab self-assigned this Oct 3, 2016
@mattab
Copy link
Member Author

mattab commented Oct 3, 2016

First related commit in 3abffcf

Then was changed in this diff as part of a big commit:
diff

This Segmentation.js code is such a mess - it was from the beginning when it was initially contributed. We shall rewrite it to AngularJS in the future 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant