Due to the flaw with x-koha-query mentioned in bug 32401, it's not possible to search pending orders in Acquisitions using characters outside the Latin-1 character set.
The solution to this problem is to use the "q" parameter instead of the "x-koha-query" header. While the "q" parameter runs the risk of creating too long of a URL, it is more functional than the "x-koha-query" header. Really we should be doing POSTs to the REST API when using DataTables, but the "good enough" fix here is to just change "header_filter" from "true" to "false" in koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
Created attachment 144432 [details] [review] Bug 32406: Switch acq datatable from headers to query param This patch changes the pending orders datatable from using the x-koha-query header to the "q" query parameter, so that it is able to support UTF-8 encoded scripts rather than just Latin-1 scripts. Test plan: 1. Apply patch 2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29 3. Change title from "Gairm" to "五" (alternatively use "cœur" or Arabic title) 4. Create a basket containing multiple records including bib 29 五 5. Close the basket 6. Receive shipment 7. You should be on a page like the following: http://localhost:8081/cgi-bin/koha/acqui/parcel.pl?invoiceid=3 8. In the search box, type in 五 9. Note that you see a "Processing..." box and then the results are filtered to just show the order for 五
Shouldn't we simply remove the line? :) false is the default value.
Created attachment 144446 [details] [review] Bug 32406: Switch acq datatable from headers to query param This patch changes the pending orders datatable from using the x-koha-query header to the "q" query parameter, so that it is able to support UTF-8 encoded scripts rather than just Latin-1 scripts. Test plan: 1. Apply patch 2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29 3. Change title from "Gairm" to "五" (alternatively use "cœur" or Arabic title) 4. Create a basket containing multiple records including bib 29 五 5. Close the basket 6. Receive shipment 7. You should be on a page like the following: http://localhost:8081/cgi-bin/koha/acqui/parcel.pl?invoiceid=3 8. In the search box, type in 五 9. Note that you see a "Processing..." box and then the results are filtered to just show the order for 五 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> tcohen amend: removed the line instead as we are probably phasing out that DT configuration option anyway.
Just posted a comment on 32401 about encoding header. This is a move from header to URL parameter. Could we have a privacy issue with exposing search terms like that, since URLs are much more visible? Log files, etc.
(In reply to Marcel de Rooy from comment #5) > Just posted a comment on 32401 about encoding header. This is a move from > header to URL parameter. > Could we have a privacy issue with exposing search terms like that, since > URLs are much more visible? Log files, etc. For bug 32406, I wouldn't worry about it, because it's order data. It's unlikely to be sensitive. But it's an interesting point. In master, the search is already put in the "q" parameter for http://localhost:8081/cgi-bin/koha/members/member.pl I suppose things like email addresses, phone numbers, usernames, etc could potentially be passed through that and wind up in logs. It wouldn't necessarily be that coherent though. But I think it would be fair to argue that searches should be POSTs. Of course, that gets complicated in terms of a RESTful interface. I think one could consider the "search" to be the resource though, so POSTing to create a search makes sense. Bit of a philosophical-technical discussion to have there I think.
But in the context of bug 32406, I think it would be fair to push QA, as it would be making the usage consistent across Koha.
Created attachment 145924 [details] [review] Bug 32406: Switch acq datatable from headers to query param This patch changes the pending orders datatable from using the x-koha-query header to the "q" query parameter, so that it is able to support UTF-8 encoded scripts rather than just Latin-1 scripts. Test plan: 1. Apply patch 2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29 3. Change title from "Gairm" to "五" (alternatively use "cœur" or Arabic title) 4. Create a basket containing multiple records including bib 29 五 5. Close the basket 6. Receive shipment 7. You should be on a page like the following: http://localhost:8081/cgi-bin/koha/acqui/parcel.pl?invoiceid=3 8. In the search box, type in 五 9. Note that you see a "Processing..." box and then the results are filtered to just show the order for 五 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> tcohen amend: removed the line instead as we are probably phasing out that DT configuration option anyway. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Backported to 22.05.x for upcoming 22.05.10
applied to 21.11.x for 21.11.16
Not backported to 21.05.x