Bugzilla – Attachment 143705 Details for
Bug 32166
When adding to a basket from a staged file we may use the wrong inputs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32166: Use import record id for retrieving correct inputs
Bug-32166-Use-import-record-id-for-retrieving-corr.patch (text/plain), 16.67 KB, created by
Nick Clemens (kidclamp)
on 2022-11-10 20:19:43 UTC
(
hide
)
Description:
Bug 32166: Use import record id for retrieving correct inputs
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-11-10 20:19:43 UTC
Size:
16.67 KB
patch
obsolete
>From 80777af62225c2b9cc570da7d4a49e461e3ab9a5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 10 Nov 2022 20:11:58 +0000 >Subject: [PATCH] Bug 32166: Use import record id for retrieving correct inputs > >When importing from a staged file we retrieve the records form the DB, skip any that are not selected, >and process the rest. > >When we skip some, we still raise our record count, and use this to retrieve the inputs. > >When building the page, we don't increment for skipped reocrds, so there can be a mismatch, i.e. >Record #1 on the page to add records may be the 3rd record in the import file > >Rather than using a counting system, let us use the import record id directly > >To test: > 0 - Set system preferences: > >MarcFieldsToOrder: >price: 949$g >quantity: 949$k >budget_code: 949$l >discount: 949$m >sort1: 949$n >sort2: 949$q > >MarcItemFieldsToOrder: >homebranch: 949$a >holdingbranch: 949$b >itype: 949$y >nonpublic_note: 949$x >public_note: 949$z >loc: 949$c >ccode: 949$8 >notforloan: 949$7 >uri: 949$u >copyno: 949$t >price: 949$g >replacementprice: 949$v >itemcallnumber: 949$o >quantity: 949$k >budget_code: 949$l > > 1 - Stage attached sample file, Format:MARCXML, Record matching:Koha biblio 999$c > 2 - Add to a basket from the staged file > 3 - Select 1st record to basket and save > 4 - Record is added with the fields above as expected > 5 - Add to basket again, select 2nd record > 6 - Record is added with price from 020a, ignoring incoming fields > 7 - Repeat with 3rd, same problem > 8 - Apply patch > 9 - Stage file and repeat step 3 >10 - Confirm added with correct values >11 - Add 2nd record and save, values correct >12 - Add 3rd record, values correct >--- > acqui/addorderiso2709.pl | 28 +++++++++---------- > .../prog/en/modules/acqui/addorderiso2709.tt | 28 +++++++++---------- > 2 files changed, 28 insertions(+), 28 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index b5fd3a090b..eb8dc68e72 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -205,21 +205,21 @@ if ($op eq ""){ > $import_record->import_biblio->matched_biblionumber($biblionumber)->store; > > # Add items from MarcItemFieldsToOrder >- my @homebranches = $input->multi_param('homebranch_' . $biblio_count); >+ my @homebranches = $input->multi_param('homebranch_' . $import_record->import_record_id); > my $count = scalar @homebranches; >- my @holdingbranches = $input->multi_param('holdingbranch_' . $biblio_count); >- my @itypes = $input->multi_param('itype_' . $biblio_count); >- my @nonpublic_notes = $input->multi_param('nonpublic_note_' . $biblio_count); >- my @public_notes = $input->multi_param('public_note_' . $biblio_count); >- my @locs = $input->multi_param('loc_' . $biblio_count); >- my @ccodes = $input->multi_param('ccode_' . $biblio_count); >- my @notforloans = $input->multi_param('notforloan_' . $biblio_count); >- my @uris = $input->multi_param('uri_' . $biblio_count); >- my @copynos = $input->multi_param('copyno_' . $biblio_count); >- my @budget_codes = $input->multi_param('budget_code_' . $biblio_count); >- my @itemprices = $input->multi_param('itemprice_' . $biblio_count); >- my @replacementprices = $input->multi_param('replacementprice_' . $biblio_count); >- my @itemcallnumbers = $input->multi_param('itemcallnumber_' . $biblio_count); >+ my @holdingbranches = $input->multi_param('holdingbranch_' . $import_record->import_record_id); >+ my @itypes = $input->multi_param('itype_' . $import_record->import_record_id); >+ my @nonpublic_notes = $input->multi_param('nonpublic_note_' . $import_record->import_record_id); >+ my @public_notes = $input->multi_param('public_note_' . $import_record->import_record_id); >+ my @locs = $input->multi_param('loc_' . $import_record->import_record_id); >+ my @ccodes = $input->multi_param('ccode_' . $import_record->import_record_id); >+ my @notforloans = $input->multi_param('notforloan_' . $import_record->import_record_id); >+ my @uris = $input->multi_param('uri_' . $import_record->import_record_id); >+ my @copynos = $input->multi_param('copyno_' . $import_record->import_record_id); >+ my @budget_codes = $input->multi_param('budget_code_' . $import_record->import_record_id); >+ my @itemprices = $input->multi_param('itemprice_' . $import_record->import_record_id); >+ my @replacementprices = $input->multi_param('replacementprice_' . $import_record->import_record_id); >+ my @itemcallnumbers = $input->multi_param('itemcallnumber_' . $import_record->import_record_id); > my $itemcreation = 0; > > my @itemnumbers; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index 77fbe6e770..760db5213a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -210,7 +210,7 @@ > <ol> > <li> > <label for="homebranch_item_[% item.item_id | html %]">homebranch</label> >- <select id="homebranch_item_[% item.item_id | html %]" name="homebranch_[% item.biblio_count | html %]"> >+ <select id="homebranch_item_[% item.item_id | html %]" name="homebranch_[% biblio.import_record_id | html %]"> > [% FOREACH l IN libraries %] > [% IF l.branchcode == item.homebranch %] > <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> >@@ -223,7 +223,7 @@ > > <li> > <label for="holdingbranch_item_[% item.item_id | html %]">holdingbranch</label> >- <select id="holdingbranch_item_[% item.item_id | html %]" name="holdingbranch_[% item.biblio_count | html %]"> >+ <select id="holdingbranch_item_[% item.item_id | html %]" name="holdingbranch_[% biblio.import_record_id | html %]"> > [% FOREACH l IN libraries %] > [% IF l.branchcode == item.holdingbranch %] > <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> >@@ -235,7 +235,7 @@ > </li> > <li> > <label for="itype_item_[% item.item_id | html %]">itype</label> >- <select id="itype_item_[% item.item_id | html %]" name="itype_[% item.biblio_count | html %]"> >+ <select id="itype_item_[% item.item_id | html %]" name="itype_[% biblio.import_record_id | html %]"> > [% FOREACH itemtype IN itemtypes %] > [% IF itemtype.itemtype == item.itype %] > <option value="[% itemtype.itemtype | html %]" selected="selected">[% itemtype.description | html %]</option> >@@ -248,15 +248,15 @@ > > <li> > <label for="nonpublic_note_item_[% item.item_id | html %]">nonpublic_note</label> >- <input type="text" id="nonpublic_note_item_[% item.item_id | html %]" name="nonpublic_note_[% item.biblio_count | html %]" value="[% item.nonpublic_note | html %]"> >+ <input type="text" id="nonpublic_note_item_[% item.item_id | html %]" name="nonpublic_note_[% biblio.import_record_id | html %]" value="[% item.nonpublic_note | html %]"> > </li> > <li> > <label for="public_note_item_[% item.item_id | html %]">public_note</label> >- <input type="text" id="public_note_item_[% item.item_id | html %]" name="public_note_[% item.biblio_count | html %]" value="[% item.public_note | html %]"> >+ <input type="text" id="public_note_item_[% item.item_id | html %]" name="public_note_[% biblio.import_record_id | html %]" value="[% item.public_note | html %]"> > </li> > <li> > <label for="loc_item_[% item.item_id | html %]">loc</label> >- <select id="loc_item_[% item.item_id | html %]" name="loc_[% item.biblio_count | html %]"> >+ <select id="loc_item_[% item.item_id | html %]" name="loc_[% biblio.import_record_id | html %]"> > <option value=""> </option> > [% FOREACH locationloo IN locationloop %] > [% IF ( locationloo.code ) == (item.loc) %] >@@ -270,7 +270,7 @@ > > <li> > <label for="ccode_item_[% item.item_id | html %]">ccode</label> >- <select id="ccode_item_[% item.item_id | html %]" name="ccode_[% item.biblio_count | html %]"> >+ <select id="ccode_item_[% item.item_id | html %]" name="ccode_[% biblio.import_record_id | html %]"> > <option value=""> </option> > [% FOREACH ccodeloo IN ccodeloop %] > [% IF ( ccodeloo.code ) == (item.ccode) %] >@@ -284,7 +284,7 @@ > > <li> > <label for="notforloan_item_[% item.item_id | html %]">notforloan</label> >- <select id="notforloan_item_[% item.item_id | html %]" name="notforloan_[% item.biblio_count | html %]"> >+ <select id="notforloan_item_[% item.item_id | html %]" name="notforloan_[% biblio.import_record_id | html %]"> > <option value=""> </option> > [% FOREACH n IN notforloanloop %] > [% IF n.code == item.notforloan %] >@@ -297,15 +297,15 @@ > </li> > <li> > <label for="uri_item_[% item.item_id | html %]">uri</label> >- <input type="text" id="uri_item_[% item.item_id | html %]" name="uri_[% item.biblio_count | html %]" value="[% item.uri | html %]"> >+ <input type="text" id="uri_item_[% item.item_id | html %]" name="uri_[% biblio.import_record_id | html %]" value="[% item.uri | html %]"> > </li> > <li> > <label for="copyno_item_[% item.item_id | html %]">copyno</label> >- <input type="text" id="copyno_item_[% item.item_id | html %]" name="copyno_[% item.biblio_count | html %]" value="[% item.copyno | html %]"> >+ <input type="text" id="copyno_item_[% item.item_id | html %]" name="copyno_[% biblio.import_record_id | html %]" value="[% item.copyno | html %]"> > </li> > <li> > <label for="budget_code_item_[% item.item_id | html %]">budget_code</label> >- <select class="budget_code_item" id="budget_code_item_[% item.item_id | html %]" name="budget_code_[% item.biblio_count | html %]"> >+ <select class="budget_code_item" id="budget_code_item_[% item.item_id | html %]" name="budget_code_[% biblio.import_record_id | html %]"> > <option value="">Select a fund (will use default if set)</option> > [% FOREACH budget_loo IN budget_loop %] > [% IF ( budget_loo.b_id ) == ( item.budget_id ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option> >@@ -317,15 +317,15 @@ > </li> > <li> > <label for="price_item_[% item.item_id | html %]">price</label> >- <input type="text" id="price_item_[% item.item_id | html %]" name="itemprice_[% item.biblio_count | html %]" value="[% item.itemprice | html %]"> >+ <input type="text" id="price_item_[% item.item_id | html %]" name="itemprice_[% biblio.import_record_id | html %]" value="[% item.itemprice | html %]"> > </li> > <li> > <label for="replacementprice_item_[% item.item_id | html %]">replacement price</label> >- <input type="text" id="replacementprice_item_[% item.item_id | html %]" name="replacementprice_[% item.biblio_count | html %]" value="[% item.replacementprice | html %]"> >+ <input type="text" id="replacementprice_item_[% item.item_id | html %]" name="replacementprice_[% biblio.import_record_id | html %]" value="[% item.replacementprice | html %]"> > </li> > <li> > <label for="callnumber_item_[% item.item_id | html %]">callnumber</label> >- <input type="text" id="callnumber_item_[% item.item_id | html %]" name="itemcallnumber_[% item.biblio_count | html %]" value="[% item.itemcallnumber | html %]"> >+ <input type="text" id="callnumber_item_[% item.item_id | html %]" name="itemcallnumber_[% biblio.import_record_id | html %]" value="[% item.itemcallnumber | html %]"> > </li> > </ol> > </fieldset> >-- >2.30.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 32166
:
143705
|
143706
|
143916
|
143953