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

Performance report not working from pages report when segment is in use #20030

Closed
taru18 opened this issue Nov 18, 2022 · 4 comments
Closed

Performance report not working from pages report when segment is in use #20030

taru18 opened this issue Nov 18, 2022 · 4 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@taru18
Copy link

taru18 commented Nov 18, 2022

Expected Behavior

User should be able to use lower/greater than signs (< >) in segment names.
The pages report should show performance reports whether a segment is in use or not.

Current Behavior

When selecting Performance icon from Pages report when segment is being used, the UI gives an error:
"Error: The segment condition 'actions&gt' is not valid." After this the menu disappears, too.

We found out that if the segment contains a suitable condition such as greater than (>), then the url will contain that character as html-encoded ( & gt; ) and the url of the user interface link will be broken with a semicolon. This only happens from the pages report when clicking the performance icon.

Steps to Reproduce (for Bugs)

  • Rename a segment so it has lower than or greater than sign in the name.
  • Select Performance icon from Pages while also using the renamed segment.

Your Environment

PHP version: 8.0.22
MySQL version: 10.1.36-MariaDB
Matomo version: 4.10.1

@taru18 taru18 added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Nov 18, 2022
@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Nov 21, 2022
@bx80
Copy link
Contributor

bx80 commented Nov 21, 2022

Thanks for reporting this @taru18, I can confirm this issue 👍

ERROR Piwik\ExceptionHandler[2022-11-21 00:26:02 UTC] [11671] Uncaught exception: /var/www/matomo/core/Segment/SegmentExpression.php(119): The segment condition 'continentCode&gt' is not valid. [Query: ?segment=continentCode%3E%3Deur&date=2022-10-23&module=PagePerformance&action=indexPagePerformance&apiMethod=Actions.getPageUrls&label=%2540%252Foptoutjs2.html&idSite=1&period=year, CLI mode: 0]

@bx80 bx80 added this to the For Prioritization milestone Nov 21, 2022
@sgiehl
Copy link
Member

sgiehl commented Nov 21, 2022

Looks like the parameter is sanitized too often somewhere. I'll have a quick look and set up a PR if it's easy to fix.

@kompa3
Copy link

kompa3 commented Dec 15, 2022

Is it possible to get this fix also to next Matomo 4.x release since it's a bug that now affects the current Matomo version?

@sgiehl
Copy link
Member

sgiehl commented Dec 15, 2022

No, this isn't planned. The new methods used in this fix are only available in the Matomo 5.x codebase. Therefor we would need to backport much more stuff, which is not worth the effort.
A first beta of Matomo 5 is planned to be released early next year.

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.
Projects
None yet
Development

No branches or pull requests

4 participants