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

Assorted events and changes #12496

Merged
merged 7 commits into from Mar 6, 2018
Merged

Assorted events and changes #12496

merged 7 commits into from Mar 6, 2018

Conversation

diosmosis
Copy link
Member

@diosmosis diosmosis commented Jan 23, 2018

Changes:

  • Throw an exception in Period\Factory::build() if $date is null. This happened while I was developing and it took me a very long time to figure out what was going on. An exception would have helped.
  • Use Request::getRenamedModuleAndAction() in Visualization. I found that was the one spot that didn't call this function before using Piwik\Api\Proxy.
  • Add new SitesManager.shouldPerformEmptySiteCheck event so plugins can disable the check for certain sites.
  • Added API.Request.intercept event to in API\Proxy. If a plugin sets $returnedValue, the actual function call is skipped.
  • Added Request.shouldDisablePostProcessing so plugins can disable datatable post processing for certain requests (if, for example, the request's post processing is done somewhere else).
  • Make sure datatable metadata is serialized w/ the datatable so information like report totals shows up when serialize=1&original=1. Don't think this will have a effect on DB size since only the rows are stored in the DB. Not sure what else serializes DataTable.

Note: I can cherry pick this into multiple PRs if needed & am also open to changing it.

@mattab mattab added this to the 3.3.1 milestone Jan 23, 2018
@mattab mattab added the Needs Review PRs that need a code review label Jan 23, 2018
@tsteur
Copy link
Member

tsteur commented Jan 23, 2018

Re $context in Request.getRenamedModuleAndAction not sure. How come this is needed? Is there an API and Controller with the same name? In theory, Request.getRenamedModuleAndAction should actually only be applied to controllers as API's are not an action but rather a method: Request.getRenamedModuleAndMethod.

@diosmosis
Copy link
Member Author

@tsteur Modified this PR based on our slack convo, had to add two more changes to get my use case to work. Let me know if there's still an issue.

@tsteur
Copy link
Member

tsteur commented Jan 29, 2018

Looks good @diosmosis
I would have possibly triggered another event for the $returnedValue to simply not pass two parameters by reference and maybe some other plugin changes finalParameters but by then maybe some plugin has already set a $returnedValue based on the initial finalParameters but could also leave it like this. Having a separate event for that purpose of generating a response may be a bit more clear.

@diosmosis
Copy link
Member Author

@tsteur Updated this PR to have a new event API.Request.intercept.

@tsteur
Copy link
Member

tsteur commented Feb 11, 2018

👍

@diosmosis
Copy link
Member Author

@matomo-org/core-team would it be possible to merge this PR?

@tsteur
Copy link
Member

tsteur commented Mar 5, 2018

Just one more thing: Can you mention the new events in the CHANGELOG.md? Happy to merge afterwards

…ocessing, SitesManager.shouldPerformEmptySiteCheck to changelog.
@diosmosis
Copy link
Member Author

@tsteur rebased + edited the changelog, test failure seems unrelated.

@tsteur tsteur merged commit ee85482 into 3.x-dev Mar 6, 2018
@tsteur
Copy link
Member

tsteur commented Mar 6, 2018

👍

@tsteur tsteur deleted the assorted-events-and-fixes branch March 6, 2018 01:10
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
* Throw exception if date is empty in Period\Factory::build() since it can occur during development.

* Add API.Request.intercept event in API\Proxy so plugins can preempt normal API execution.

* Use Request::getRenamedModuleAndAction() in Visualization, as it is called in every other use of core/API/Proxy.

* Add new SitesManager.shouldPerformEmptySiteCheck event.

* Add event Request.shouldDisablePostProcessing so plugins can disable datatable post processing for certain requests.

* Make sure DataTable metadata is serialized with the table.

* Add description of API.Request.intercept, Request.shouldDisablePostProcessing, SitesManager.shouldPerformEmptySiteCheck to changelog.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants