Skip to content

Fix sorting for ecommerce item reports #21863

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

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Jan 31, 2024

Description:

Sorting of ecommerce item reports currently does not work correctly in some case.
Sometimes when trying to sort for e.g. item views, the reports are sorted by label instead.

The reason for that can be found in the way the reports are built. As e.g. item view metrics are only added for those items that actually had any views tracked, not all rows the report contains the same set of columns.

The sorting is then currently broken, if the first row does not contain the column that was requested for sorting. See #21829 (comment) for further details.

This fix was the one with the lowest required effort. It might nevertheless be good to start a discussion at some point around how to ensure that all rows in a report contain the same set of columns, as this could lead to problems elsewhere as well.

fixes #21829

Review

@sgiehl sgiehl added this to the 5.0.2 milestone Jan 31, 2024
@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Jan 31, 2024
@sgiehl sgiehl requested a review from a team January 31, 2024 15:29
@sgiehl sgiehl marked this pull request as ready for review January 31, 2024 15:30
@sgiehl sgiehl changed the base branch from 5.x-dev to 5.0.x-dev January 31, 2024 15:43
@sgiehl sgiehl force-pushed the fixecommercesorting branch from e195a4f to a9bf061 Compare January 31, 2024 15:45
Copy link
Contributor

@bx80 bx80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Would it be worth creating another ticket to kick off the general discussion about missing columns?

Copy link
Contributor

@michalkleiner michalkleiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look ok, but yeah, this might be a problem in other places, so a follow up ticket might be good.

@sgiehl sgiehl merged commit 3732ca5 into 5.0.x-dev Feb 1, 2024
@sgiehl sgiehl deleted the fixecommercesorting branch February 1, 2024 10:31
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Feb 5, 2024
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. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

[Bug] Sorting Product Revenue in Ecommerce not working
3 participants