Bugzilla – Attachment 158214 Details for
Bug 35073
Serials batch edit deletes unchanged additional fields data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35073: Default to existing value if there is one
Bug-35073-Default-to-existing-value-if-there-is-on.patch (text/plain), 2.38 KB, created by
Victor Grousset/tuxayo
on 2023-11-01 21:12:25 UTC
(
hide
)
Description:
Bug 35073: Default to existing value if there is one
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2023-11-01 21:12:25 UTC
Size:
2.38 KB
patch
obsolete
>From 4c11303b04366c72ca5418066e8b63ca6919f093 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 17 Oct 2023 09:20:59 +0000 >Subject: [PATCH] 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> >--- > serials/subscription-batchedit.pl | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/serials/subscription-batchedit.pl b/serials/subscription-batchedit.pl >index dd06fe4a22..2c31fa9f12 100755 >--- a/serials/subscription-batchedit.pl >+++ b/serials/subscription-batchedit.pl >@@ -84,6 +84,14 @@ if ($batchedit) { > id => $field->id, > value => $value, > }; >+ }else{ >+ my $existing = $subscription->additional_field_values->search( { field_id => $field->id } )->last; >+ if($existing && $existing->value){ >+ push @additional_field_values, { >+ id => $field->id, >+ value => $existing->value, >+ }; >+ } > } > } > $subscription->set_additional_fields(\@additional_field_values); >-- >2.42.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35073
:
157221
|
157222
|
157223
|
158038
|
158039
|
158040
|
158213
| 158214 |
158215