Bugzilla – Attachment 160839 Details for
Bug 33639
Adding item to item group from 'Add item' screen doesn't work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33639: Make add item to item group work from additem.pl
Bug-33639-Make-add-item-to-item-group-work-from-ad.patch (text/plain), 4.32 KB, created by
Martin Renvoize
on 2024-01-11 11:32:44 UTC
(
hide
)
Description:
Bug 33639: Make add item to item group work from additem.pl
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2024-01-11 11:32:44 UTC
Size:
4.32 KB
patch
obsolete
>From 62dbf0f3210e052d6bd0ac315a13a3bb5210a463 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 2 Jan 2024 17:49:45 +0000 >Subject: [PATCH] Bug 33639: Make add item to item group work from additem.pl > >To test: > >1, Create one or more item groups for a bib if needed >2. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save. >3. On the Normal tab, see that the item has not been added to the item group you selected. >4. APPLY PATCH, restart_all >5. Try 1-3 again but this time the item should succesffuly be added to the item group. >6. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown. >7. Name the new item group. >8. Make sure it is correctly added to the item group. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > cataloguing/additem.pl | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index f92e3467fd7..cb517a51c79 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -62,8 +62,8 @@ sub add_item_to_item_group { > if ( $item_group eq 'create' ) { > my $item_group = Koha::Biblio::ItemGroup->new( > { >- biblionumber => $biblionumber, >- description => $item_group_description, >+ biblio_id => $biblionumber, >+ description => $item_group_description, > } > )->store(); > >@@ -75,8 +75,8 @@ sub add_item_to_item_group { > > my $item_group_item = Koha::Biblio::ItemGroup::Item->new( > { >- itemnumber => $itemnumber, >- item_group_id => $item_group_id, >+ item_id => $itemnumber, >+ item_group_id => $item_group_id, > } > )->store(); > } >@@ -129,13 +129,13 @@ my $hostitemnumber = $input->param('hostitemnumber'); > my $marcflavour = C4::Context->preference("marcflavour"); > my $searchid = $input->param('searchid'); > # fast cataloguing datas >-my $fa_circborrowernumber = $input->param('circborrowernumber'); >-my $fa_barcode = $input->param('barcode'); >-my $fa_branch = $input->param('branch'); >-my $fa_stickyduedate = $input->param('stickyduedate'); >-my $fa_duedatespec = $input->param('duedatespec'); >-my $volume = $input->param('volume'); >-my $volume_description = $input->param('volume_description'); >+my $fa_circborrowernumber = $input->param('circborrowernumber'); >+my $fa_barcode = $input->param('barcode'); >+my $fa_branch = $input->param('branch'); >+my $fa_stickyduedate = $input->param('stickyduedate'); >+my $fa_duedatespec = $input->param('duedatespec'); >+my $item_group = $input->param('item_group'); >+my $item_group_description = $input->param('item_group_description'); > > our $frameworkcode = &GetFrameworkCode($biblionumber); > >@@ -330,9 +330,9 @@ if ($op eq "additem") { > > $current_item = $item->unblessed; # Restore edit form for the same item > } >- else { >+ unless ( @errors ) { > $item->store->discard_changes; >- add_item_to_item_group( $item->biblionumber, $item->biblioitemnumber, $volume, $volume_description ); >+ add_item_to_item_group( $item->biblionumber, $item->itemnumber, $item_group, $item_group_description ); > > # This is a bit tricky : if there is a cookie for the last created item and > # we just added an item, the cookie value is not correct yet (it will be updated >@@ -443,7 +443,10 @@ if ($op eq "additem") { > { skip_record_index => 1 } ); > $current_item->discard_changes; # Cannot chain discard_changes > $current_item = $current_item->unblessed; >- add_item_to_item_group( $item->biblionumber, $item->biblioitemnumber, $volume, $volume_description ); >+ add_item_to_item_group( >+ $item->biblionumber, $item->biblioitemnumber, $item_group, >+ $item_group_description >+ ); > > # We count the item only if it was really added > # That way, all items are added, even if there was some already existing barcodes >-- >2.43.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 33639
:
150422
|
151383
|
151428
|
160418
|
160441
| 160839