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

Reuse datatable's metadata when merging subtables #9778

Merged
merged 2 commits into from Feb 15, 2016

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Feb 14, 2016

As described in #9773 the all referrers goal metrics didn't contain the goal names.
After debugging a while I found out, that this is caused by DataTable::mergeSubtables, which is used to create the report. This method returns a complete new DataTable object. The metadata of the original datatable is lost.
As the site metadata is so missing in the new DataTable object, the goal metrics are not able to load the goal name.

Copying the metadata to the new datatable object fixes this issue.

Not sure if that might have any side effects...

fixes #9773

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Feb 14, 2016
@tsteur
Copy link
Member

tsteur commented Feb 14, 2016

I had a look at the code and as it is only used by Referrers so far, it should work.

In general, we store total values, processed_metrics_computed flags, etc ... in there. Meaning in some cases the metadata should be maybe not copied, as it could result in wrong values. However, should be fine and is possible expected in this case.

Is it possible to have a simple system or integration test for this? Otherwise LGTM

@sgiehl
Copy link
Member Author

sgiehl commented Feb 14, 2016

I've added a simple test to check that metadata is kept when merging subtables

tsteur added a commit that referenced this pull request Feb 15, 2016
Reuse datatable's metadata when merging subtables
@tsteur tsteur merged commit f6a038b into master Feb 15, 2016
@tsteur tsteur added this to the 2.16.1 milestone Feb 15, 2016
@tsteur tsteur deleted the fixmetadataformergedsubtables branch February 15, 2016 06:43
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants