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

Fixes Goal row evolution with double quotes in the goal name resulting in an error #19485

Closed
utrautmann opened this issue Jul 6, 2022 · 2 comments · Fixed by #19490
Closed
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@utrautmann
Copy link

If a goal has double quotes in its name, then Matomo cannot plot the conversion lines in the Row evolution graph. A javascript error occurs on the console.

Current Behavior to reproduce

  1. Choose a goal with conversions
  2. Rename the goal and insert double quote in the name. F.e. Newsletter "Sport"
  3. Select the goal and go to "Goals by Referrers"
  4. Select any row with a conversion
  5. Open row evolution (see screenshot 1)
  6. Select line with conversion (see screenshot 2)

In step 6 a javascript error will occur and no line will be drawn.

screenshot 1
grafik

screenshot 2
grafik

  • Matomo Version: 4.10.1
  • Browser: Firefox
@utrautmann utrautmann added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jul 6, 2022
@bx80
Copy link
Contributor

bx80 commented Jul 7, 2022

@utrautmann Thanks for reporting this, the clear steps and screenshots are much appreciated 👍

I've managed to recreate the issue. It looks like a string escaping bug when passing axis names to jqPlot, when fixing this we should add UI tests for goals containing double and single quotes in their names.

@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Jul 7, 2022
@bx80 bx80 added this to the 4.12.0 milestone Jul 7, 2022
@sgiehl
Copy link
Member

sgiehl commented Jul 7, 2022

That one is another issue with automatically sanitizing input values (See #11786 or #4231). The goals name is stored sanitized. E.g. a " is converted to ". The javascript so holds values that are sanitized. When clicking on a metric in the row evolution, the metric is read using .text() on the clicked element. But as it's a html element, reading text decodes " back to ", causing the values not to match anymore. I'll prepare a PR that workarounds that issue for that special case, but I'm pretty sure something similar might happen again til we get rid of the input sanitizing.

@sgiehl sgiehl self-assigned this Jul 7, 2022
@justinvelluppillai justinvelluppillai changed the title Goal row evolution with double quotes in the goal name will result in an error Fixes Goal row evolution with double quotes in the goal name resulting in an error Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants