acdh-oeaw / hapa

History of Albanian Place-names: Albania
https://hapa.acdh-dev.oeaw.ac.at
MIT License
0 stars 0 forks source link

filter/lookup selector issue #23

Closed csae8092 closed 3 years ago

csae8092 commented 3 years ago

If there is no lookup-filter set, but the search field populated, the filter does not work; see e.g. https://hapa.acdh-dev.oeaw.ac.at/archiv/hapaplacename/?name=Ha&name_lookup=&alternative_names=&alternative_names_lookup=&wortbildung=&wortbildung_lookup=&etymology=&etymology_lookup=&syntax=&syntax_lookup=&comment=&comment_lookup=&internal_comment=&internal_comment_lookup=&unclear=unknown&Filter=Search

Not sure how this could be solved easily (but I also didn't look into it); anyhow it would be nice if only those filter params were sent which are actually set, because this would make the URL much more readable, e.g. only https://hapa.acdh-dev.oeaw.ac.at/archiv/hapaplacename/?name=Ha

linxOD commented 3 years ago

pushed a quick fix. The default empty lookup filter is disabled now. It will take the first element of the lookup list which is icontains. Regarding the URL I have to find out how this works.

linxOD commented 3 years ago

For future reference, fix in progress

https://stackoverflow.com/questions/5904437/jquery-how-to-remove-blank-fields-from-a-form-before-submitting

https://stackoverflow.com/questions/46834539/removing-unnecessary-filters-from-url-django-filter