Bug 19636: Hold priority changes incorrectly via dropdown select
authorLari Taskula <lari.taskula@jns.fi>
Thu, 16 Nov 2017 12:24:52 +0000 (14:24 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 20 Dec 2017 16:26:47 +0000 (13:26 -0300)
commitf6574fa7dcc9555e214908e2dba43eae1a112083
tree09264d4312d1c7f545d9d97baf7ab6c034849b03
parentdccb3a3414cb284f914d0fbeff7871a809379685
Bug 19636: Hold priority changes incorrectly via dropdown select

This patch sorts holds in UI after priority is changed via "Priority"
dropdown.

It fixes confusion where the form is posted and each row is individually
processed one by one - and due to conflict in priority value, the latter
row always gets the chosen value instead of what the user actually might
have wanted to change.

To reproduce:
1. Place 3 holds on a record
2. See existing holds (cgi-bin/koha/reserve/request.pl?biblionumber=XXX)
3. By using the dropdown menu under "Priority" column, change the first
   hold's priority to last (3). Do not touch other priorities.
4. Click Update hold(s)
5. Observe the hold did not get your selected priority 3, but 2 instead.

To test:
1. Apply patch
2. Place 3 holds on a record
3. See existing holds (cgi-bin/koha/reserve/request.pl?biblionumber=XXX)
4. By using the dropdown menu under "Priority" column, change the first
   hold's priority to last (3). Do not touch other priorities.
5. Observe this hold was automatically moved to the last row in the user
   interface.
6. Click Update hold(s)
7. Observe the hold has your selected priority 3.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt