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

ScheduledReports plugin does not support adding report parameters #11330

Open
bkbeckman opened this issue Feb 8, 2017 · 1 comment
Open

ScheduledReports plugin does not support adding report parameters #11330

bkbeckman opened this issue Feb 8, 2017 · 1 comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.

Comments

@bkbeckman
Copy link
Contributor

I'm building a plugin that integrates with ScheduledReports and I need the ability to pass in parameters.

I noticed there are callbacks for 'ScheduledReports.getReportParameters' and 'ScheduledReports.validateReportParameters'. However, it looks like the front-end does not take the results of a 'ScheduledReports.getReportParameters' into consideration when submitting the form field. Thus, the field is never populated when the user submits the form.

I added a handler with debug statements to each of these events and here are some results:

Piwik\Plugins\MyPlugin\MyPlugin::getScheduledReportParameters :: parameters :: Array
(
[emailMe] =>
[evolutionGraph] =>
[additionalEmails] =>
[displayFormat] => 1
[myCustomParameter] => 0 // here is the custom parameter that I added to the array
)
Piwik\Plugins\MyPlugin\MyPlugin::validateScheduledReportParameters :: parameters :: Array
(
[displayFormat] => 1
[emailMe] => 1
[evolutionGraph] =>
// custom parameter was not submitted
)

And form submission data from Chrome:

idReport:0
description:description
idSegment:
reportType:email
reportFormat:html
reports[]:MyCustomReport1
reports[]:MyCustomReport2
parameters[displayFormat]:1
parameters[emailMe]:true
parameters[evolutionGraph]:false
token_auth:

I believe the problem can be traced to the reportParametersScheduledReports.twig
file. As you can see, the parameters to submit are hard-coded in the javascript instead of being pulled dynamically from the $availableParameters variable.

@mattab
Copy link
Member

mattab commented Feb 21, 2017

Thanks for the feedback @bkbeckman - we would welcome a pull request implementing this change and allowing you to build your plugin with custom parameters. So hopefully you have a chance to create and submit this PR for our review? 👍

@mattab mattab added this to the Priority Backlog (Help wanted) milestone Feb 21, 2017
@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
Projects
None yet
Development

No branches or pull requests

2 participants