Bugzilla – Attachment 168960 Details for
Bug 37357
Authorised values in control fields cause Javascript errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37357: Map @ to 00 for control field select lists
Bug-37357-Map--to-00-for-control-field-select-list.patch (text/plain), 2.00 KB, created by
David Cook
on 2024-07-15 04:03:55 UTC
(
hide
)
Description:
Bug 37357: Map @ to 00 for control field select lists
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-07-15 04:03:55 UTC
Size:
2.00 KB
patch
obsolete
>From 8544eeae74d211d0e2c4e05fd5621f2112f7712a Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 15 Jul 2024 03:59:23 +0000 >Subject: [PATCH] Bug 37357: Map @ to 00 for control field select lists > >This change adds the existing @ to 00 mapping for control fields >to work for authorized value select lists as well. > >Test plan: >0. Apply the patch >1. koha-plack --reload kohadev >2. Make 001 subfield @ mandatory and give >it an authorised value of branches for Default framework >3. Go to the New record editor for a Default record >4. Click "Save" >5. Note that the editor prompts you to fill in the 001 field >6. Fill in required fields and click "Save" >7. Note that all data is captured correctly >8. prove t/db_dependent/Koha/UI/Form/Builder/Biblio.t > >To prove that this wouldn't work without the patch, try the test >plan on a different branch without this patch. You won't be prompted >to fill in mandatory fields and the record will just save (or if a >possible duplicate is detected it will just redirect you back to an empty >editor) >--- > Koha/UI/Form/Builder/Biblio.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Biblio.pm b/Koha/UI/Form/Builder/Biblio.pm >index 66b4002e81..c17d4965e4 100644 >--- a/Koha/UI/Form/Builder/Biblio.pm >+++ b/Koha/UI/Form/Builder/Biblio.pm >@@ -361,10 +361,13 @@ sub build_authorized_values_list { > } > } > >+ my $id_subfield = $subfield; >+ $id_subfield = "00" if $id_subfield eq "@"; >+ > return { > type => 'select', >- id => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, >- name => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, >+ id => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield, >+ name => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield, > default => $value, > values => \@authorised_values, > labels => \%authorised_lib, >-- >2.39.2
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 37357
:
168960
|
169036
|
169092