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

use form values instead of request params in filtersAction #671

Open
soeren-helbig opened this issue Oct 9, 2013 · 1 comment
Open

use form values instead of request params in filtersAction #671

soeren-helbig opened this issue Oct 9, 2013 · 1 comment

Comments

@soeren-helbig
Copy link
Contributor

I have several DataTransformers appended to form types. Some of them i need inside the filter form. After a little code review, i noticed the form values are not used for setting filters.

//templates\CommonAdmin\ListAction\filters.php.twig
if ($this->getRequest()->getMethod() == "GET") {
    $filters = $this->getRequest()->query->all();
}

but some lines above there i read this:

//templates\CommonAdmin\ListAction\filters.php.twig
if ($this->getRequest()->getMethod() == "POST") {
    $form = $this->getFilterForm();
    $form->bind($this->get('request'));

    if ($form->isValid()) {
        $filters = $form->getClientData();
    }
}

please, can you help me understand this? in my opinion, if form values are valid there is nothing against using them instead of query parameters, isn't it?!

@sescandell
Copy link
Member

Hi @soeren-helbig

Query parameters are used for scope.

If you use "normal" case for filters, you should be in a post request and so FilterForm should be submitted and so your DataTransformers should be used.

Or maybe I missed something in what you wanted to point out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants