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

Adds new ViewDataTable.configure.end event #14355

Merged
merged 2 commits into from Apr 19, 2019
Merged

Adds new ViewDataTable.configure.end event #14355

merged 2 commits into from Apr 19, 2019

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Apr 17, 2019

While developing a plugin I tried to add a footer message to an existing report when the report is shown flattened. I tried that using the event ViewDataTable.configure with following code.

if ('Plugin.method' === $view->requestConfig->apiMethodToRequestDataTable && $view->requestConfig->flat) {
    $view->config->show_footer_message = $message;
}

I wondered why that worked when switching to the flattened view, but not after reloading the page (having the report still flattened).
The reason is, that the saved viewdata parameters are injected after the event is posted. That means that $view->requestConfig->flat holds the default value false until then.

My expectations would have been, that the event already gets the final parameters. If that's wrong maybe we could add a new event ViewDataTable.configure.end or similar that works with the final parameters?

ping @tsteur @diosmosis @mattab

@sgiehl sgiehl added the Needs Review PRs that need a code review label Apr 17, 2019
@sgiehl sgiehl added this to the 3.10.0 milestone Apr 17, 2019
@sgiehl sgiehl changed the title Post ViewDataTable.configure event later Adds new ViewDataTable.configure.end event Apr 19, 2019
@sgiehl
Copy link
Member Author

sgiehl commented Apr 19, 2019

@tsteur added a new event ViewDataTable.configure.end instead of moving the other one

@tsteur tsteur merged commit fc4cfd9 into 3.x-dev Apr 19, 2019
@tsteur tsteur deleted the viewconfigureevent branch April 19, 2019 21:15
@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Jun 29, 2019
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. 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