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 Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
85791f4aba
commit
7d31f77ae6
2 changed files with 28 additions and 28 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue