Bug #4090

Incorrect URL for paging in Event search

Added by Radko Krkoš 9 months ago. Updated 5 months ago.

Status:ClosedStart date:05/15/2018
Priority:HighDue date:
Assignee:Jan Mach% Done:

100%

Category:Development - GUI
Target version:2.1

Description

For event searches using multiple choice dropdowns with multiple options selected, the URL for Next and Previous pages only contains the first selected option.

How to reproduce:
  1. Set up query: SELECT * FROM events WHERE “category” && ARRAY['Abusive.Spam’, 'Information.UnauthorizedAccess’] ORDER BY “detecttime” DESC LIMIT 100;
  2. The URL for result page is: https://mentat-alt.cesnet.cz/mentat/events/search?dt_from=&dt_to=&source_addrs=&source_ports=&categories=Abusive.Spam&categories=Information.UnauthorizedAccess&description=&submit=Search
  3. The URL for Next page is: https://mentat-alt.cesnet.cz/mentat/events/search?page=2&submit=Search&categories=Abusive.Spam
    • This is not correct, multiple categories params should be present, just like in 2.
    • This was confirmed for all multichoice dropdowns, for each only the first selected option is included (it does not matter whether they are combined or isolated for the query).

As a consequence, results diplayed for Next/Previous pages do not match the original criteria.

Associated revisions

Revision f3c669ae
Added by Jan Mach 5 months ago

Fix: Fixed the incorrectly rendered next and previous pager buttons in event search view.

Multivalue request arguments must be handled separately to get the list of all request argument values with the same name.

Resources:
http://flask.pocoo.org/docs/1.0/api/#flask.Request.args
http://werkzeug.pocoo.org/docs/0.14/datastructures/#werkzeug.datastructures.MultiDict

(Redmine issue: #4090)

Revision 9f611282
Added by Jan Mach 5 months ago

Fix: Permanently resolved all existing issues with incorrect pager links in forms with multivalues.

Previous revision f3c669ae did not fully resolve the issue with incorrect pager links. It was necessary to implement generic mechanism for storing information about which fields can contain multiple values directly in the form object. I have used static class method to solve this issue. (Redmine issue: #4090)

History

#1 Updated by Jan Mach 7 months ago

  • Parent task deleted (#3734)

#2 Updated by Jan Mach 7 months ago

  • Target version set to Future

#3 Updated by Radko Krkoš 7 months ago

  • Priority changed from Normal to High

Still present in 2.0.0, increasing priority as this makes paging unusable for multichoice selectors.

#4 Updated by Jan Mach 7 months ago

  • Target version changed from Future to 2.1

Moving to next release since this could pose problems to all users.

#5 Updated by Jan Mach 5 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Attached commits fully resolve this issue on all existing views and forms.

Also available in: Atom PDF