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

Batch-edit redirects #789

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Batch-edit redirects #789

wants to merge 2 commits into from

Conversation

luku
Copy link
Contributor

@luku luku commented Mar 5, 2017

There's a problem with $this->_helper->redirector('browse', 'items', null, $params); and multidimensional $params array, such as advanced search criteria, so this pull is fixing it.
Besides, it redirects back to selected items, or to same search params for batchAll style of batch-edit. It's practical for direct review of performed changes. So maybe not that useful for _batchEditAllSave() action, but definitely for standard batch edit.

@zerocrates
Copy link
Member

What is the problem with multidimensional arrays that this fixes?

@luku
Copy link
Contributor Author

luku commented Mar 7, 2017

Ok, here comes example:
Let's say you search all items, where DC:Title is not empty. It will produce query like: search=&advanced[0][element_id]=50&advanced[0][type]=is not empty&range=....

Now try to reproduce some error in batch edit, for example delete all items. You will be redirected to URL similar to this one: items/browse/search//advanced//range//... As you can see, the whole advanced condition got lost.

In errors.log you then see warning and the problem is in Zend\Controller\Router\Route\Module.php

It works fine with multiple one-dimensional queries like range=0-50&user=1 which produces URL: items/browse/range/0-50/user/1/...

@zerocrates
Copy link
Member

Ah okay, I see. So the heart of the issue is that it tries to use the router to express those params instead of just a query string (as we usually do).

@luku
Copy link
Contributor Author

luku commented Mar 7, 2017

Yes, in one way. I found out about it, when I tried to redirect back to the selected items, which was the actual heart of this pull request:)
Btw. is there some better way to pass to some redirector method the query params as array? Or perhaps using url() instead of manual http_build_query(). I'm open for improvements

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

Successfully merging this pull request may close these issues.

None yet

2 participants