diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-02-14 00:14:33 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-02-14 00:14:33 +0300 |
commit | 056027d3236491ebb3b60e124ab82786b0cdd72e (patch) | |
tree | c3f50db701154a5517086b36bc86597194963f90 /plugins/ScheduledReports | |
parent | 06c334b12d1b1475a68c52ee5815cd5f79fefcfb (diff) |
Let plugins change the report type in sendReport event (#14098)
This way I can set the `reportType` to eg `foobar` so it won't be handled and won't be sent. Needing this feature... Was going to add otherwise another parameter or another event but having two events with similar `sendReport` name may be confusing and another parameter could cause issues. No need to document this any further I would say.
@diosmosis can you have a quick look?
Diffstat (limited to 'plugins/ScheduledReports')
-rw-r--r-- | plugins/ScheduledReports/API.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php index 291c28b294..c4a61a3c01 100644 --- a/plugins/ScheduledReports/API.php +++ b/plugins/ScheduledReports/API.php @@ -616,6 +616,8 @@ class API extends \Piwik\Plugin\API Log::warning("Scheduled report file '%s' exists but is empty!", $outputFilename); } + $reportType = $report['type']; + /** * Triggered when sending scheduled reports. * @@ -644,7 +646,7 @@ class API extends \Piwik\Plugin\API Piwik::postEvent( self::SEND_REPORT_EVENT, array( - $report['type'], + &$reportType, $report, $contents, $filename = basename($outputFilename), |