Opening a row evolution for a subtable should always work correctly.
Sometimes when opening a row evolution for a subtable Matomo seems to choose the incorrect datatable to open the row evolution for and tries to open it with an incorrect action (and subtable id), which results in an error.
See this record:
Locally this results in
Call to undefined method Piwik\DataTable\Map::getRowFromLabel() in /srv/matomo/plugins/MarketingCampaignsReporting/API.php line 82
The failing request tries to open a row evolution with a popover parameter like
RowAction$3ARowEvolution$3AMarketingCampaignsReporting.getKeywordContentFromNameId$3A$257B$2522idSubtable$2522$253A$25222$2522$257D$3Aemail-jan2019$20$3E$20$40text, which is obviously incorrect, as the action of the parent table should be used. Correct would be
RowAction$3ARowEvolution$3AMarketingCampaignsReporting.getName$3A$257B$2522flat$2522$253A0$257D$3Aemail-jan2019 for this case.
This issue might be the real cause for https://github.com/matomo-org/plugin-MarketingCampaignsReporting/issues/61 and maybe some other errors occurring in relation to row evolution
happened on the first try for me
When we click the row evolution icon, it will trigger that code on the row action instance for the subtable row. The code notices it's in a subtable, and triggers the action for the main row, but with parameters that correctly compute the label for the subtable row.
Up to this point,
self.dataTable will be the parent table instance (where
self.dataTable.params.method = 'MarketingCampaignReporting.getName'). When it fails, that instance will be the subtable instance (where
self.dataTable.params.method = 'MarketingCampaignReporting.getKeywordFromNameId').
I'm not sure why those lines fail, I'm guessing the trigger call works on the wrong row instance. It's possible the rowactions are being created strangely or more than once, but I can't find evidence of that.