@sgiehl opened this Pull Request on April 17th 2019 Member

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 commented on April 19th 2019 Member

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

This Pull Request was closed on April 19th 2019
Powered by GitHub Issue Mirror