Bug 35073: Default to existing value if there is one
authorPedro Amorim <pedro.amorim@ptfs-europe.com>
Tue, 17 Oct 2023 09:20:59 +0000 (09:20 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 10 Nov 2023 02:06:34 +0000 (16:06 -1000)
commitbcb2adb604d74f9eebee462b19d6493a426bb67c
tree1ddde674e5c1c9bfea1c00151a625c81b92ff622
parenta5fa92d2c0cd30a982660e427285a22b8f1a8977
Bug 35073: Default to existing value if there is one

For values that dont exist in the batch edit submission, i.e. UI says 'No change', we default to existing value if there is one.

Test plan:
Preparation - Additional fields:
1) Add a new 'additional field', visit:
/cgi-bin/koha/admin/additional-fields.pl
2) Click 'subscription' and '+ New field'. Enter a 'name' and hit 'save'.

Serials:
1) Add a new serial, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, i.e. '112'. Press 'next' and click 'ok' on the alert box
3) Fill all the required fields and click 'test prediction'
4) Input something in the additional field created previously.
5) Click 'save subscription'. Notice the additional field is as expected.
6) Repeat steps 1-5 to create a second serial.

Batch edit:
1) Visit serials and hit the 'Search' button:
/cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created previously and click the new link that pops up 'edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value for the additional field is unchanged. Visit:
/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7294908de35a46f491af4e170fb9f6294a5fb4bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
serials/subscription-batchedit.pl