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

Fix for datatable row sum error #18500

Merged
merged 2 commits into from Dec 15, 2021
Merged

Fix for datatable row sum error #18500

merged 2 commits into from Dec 15, 2021

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Dec 14, 2021

Description:

Potentially fixes #18468

I've been unable to recreate the exact conditions that cause this error:

WARNING: /core/DataTable/Row.php(805): Trying to add two strings in DataTable\Row::sumRowArray: 2021-12-07 01:50:26 + 2021-12-07 02:05:12 for column _metadata in row # [‘label’ => ‘Martijn’, ‘nb_visits’ => 73, ‘nb_actions’ => 82, ‘Actions_nb_pageviews’ => 79, ‘Goal_revenue’ => 0, ‘Goal_nb_conversions’ => 0, ‘_metadata’ => array ( ‘ts_archived’ => ‘2021-12-07 01:50:26’, ), ‘visits_evolution’ => 2.076, ‘visits_evolution_trend’ => 1, ‘actions_evolution’ => 1.504, ‘actions_evolution_trend’ => 1, ‘pageviews_evolution’ (Module: MultiSites, Action: getAllWithGroups, In CLI mode: false)

But it seems likely that some archiving process is calling DataTable\Row::sumRowMetadata() to sum all row metadata values. Recent change #6784 adds the ts_archived date value to the row metadata and attempting to sum this is probably causing the error.

This PR adds a check to the DataTable\Row::sumRowMetadata() method to prevent any attempt to sum metadata values for the ts_archived column which is always going to fail.

Review

@bx80 bx80 self-assigned this Dec 14, 2021
@bx80 bx80 added 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. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Dec 14, 2021
@bx80 bx80 added this to the 4.7.0 milestone Dec 14, 2021
core/DataTable/Row.php Outdated Show resolved Hide resolved
@sgiehl sgiehl removed the Needs Review PRs that need a code review label Dec 14, 2021
@bx80 bx80 added the Needs Review PRs that need a code review label Dec 14, 2021
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

Guess that should be fine.

@sgiehl sgiehl merged commit c24a82b into 4.x-dev Dec 15, 2021
@sgiehl sgiehl deleted the m-18468-metadata-sum-error branch December 15, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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 this pull request may close these issues.

WARNING: /core/DataTable/Row.php(805) after update to 4.6.1
2 participants