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.
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...
I had a look at the code and as it is only used by Referrers so far, it should work.
In general, we store
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
I've added a simple test to check that metadata is kept when merging subtables