search: RFC: Returning to search results after form action
Use-case You are browsing a filtered set of results, and you edit a single item. The return url from the edit action should include the search params and page.
Implementation This can be implemented by a developer in their add and edit actions. I think it might be nice if the plugin could provide a cleaner api for developers to use somehow. Perhaps the PrgComponent could have a method which returns the referring url?
Sidestep
It might just be as simple as return $this->redirect($this->referrer()) in which case it might be worth just adding it to the documentation.
Thoughts I’ve created this as an RFC, just to gether some other peoples thoughts on the implementation, the value of the addition, and if it’s worth just updating the docs instead.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 30 (26 by maintainers)
That is dead-wrong IMO, any decent solution will not use any session based approach, as this will always fail with more than a single tab - and that’s a huge pain in the … and a very un-userfriendly approach. Instead the query strings should simply be appended and passed along with each URL from that page (and back) so those will always lead to the expected results inside of this tab.
I agree with @davidyell that this should be part of the search plugin here, or at least must be possible to hook in as a separate plugin functionality more easily than currently suggested. It is after all very closely related to the job this plugin does: filtering and keeping those results consistent per search and pagination/link.
Then you need to live with your URLs but at least they are “correct”. Geeze, whats so hard to get here? 😄
What if you filter and then copy and paste the URL for someone? That person with MY approach will see the same (expected!!!) thing, with the session based non-sense approach that person will see no filters applied, passing him the URL with specific filters is even impossible in that case (at least when coming back and having filters applied internally via session).
Sessions are not meant to do this thing. Doing so creates sth that is broken by design already. I strongly advice against that.
Meh I am not convinced about that (tabs) but its above the scope of this ticket.
@burzum It is okay for me to share the code of the component 😉