From 82a220a47b94ce242b9d7d59031f8c8cf0e2c02b Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 28 Apr 2023 23:47:13 +0000 Subject: [PATCH] Bug 33639: Fix selectors for adding to item group To test: Apply patch 1 - Browse to details page for a record 2 - Create or ensure the record has item group(s) 3 - Click New->New item 4 - Note the bottom of the page has a form to attach to existing group 5 - Note when a group is selected the enumchron field is populated 6 - Confirm item is saved to group when saved Note: this does not fix the 'Create new item group' feature in the dropdown. I am having trouble seeing why that would work in the first in place! --- koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js index 65a86a2175..9cffe17ab7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js @@ -135,11 +135,9 @@ $(document).ready(function(){ } $('#item-group-add-or-create-form-select').on('change', function() { - if ( ! $('input.items-enumchron').val() ) { - let item_group_selector = '#item-group-' + $(this).val(); - let enumchron = $(item_group_selector).val(); - $('input.items-enumchron').val( enumchron ); - } + let item_group_selector = '#item-group-' + $(this).val(); + let enumchron = $(item_group_selector).val(); + $('input[name="items.enumchron"]').val( enumchron ); }); }); -- 2.30.2