[Bug 32166] New: When adding to a basket from a staged file we may use the wrong inputs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Bug ID: 32166 Summary: When adding to a basket from a staged file we may use the wrong inputs Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org On addorderiso2709.pl we loop over the records in the staged batch: for my $biblio (@$biblios){ $biblio_count++; skipping any not selected, which inlcudes any already imported: next if not grep { $_ eq $$biblio{import_record_id} } @import_record_id_selected; Later we use that count to find the inputs: my @homebranches = $input->multi_param('homebranch_' . $biblio_count); The problem being that if a record is already imported, our count increases, but the input on the page still counts from 1 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 143705 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143705&action=edit 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 143706 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143706&action=edit Test records Test records for importing -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32171 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32171 [Bug 32171] Order prices not populated when adding to a basket form a staged file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrewfh@dubcolib.org --- Comment #3 from Andrew Fuerste-Henry <andrewfh@dubcolib.org> --- I got an error in testing this and bug 32171 together. The error is due to a typo in 32171. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Andrew Fuerste-Henry from comment #3)
I got an error in testing this and bug 32171 together. The error is due to a typo in 32171.
Nick, can you please check and explain a bit more about 32171? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #4)
(In reply to Andrew Fuerste-Henry from comment #3)
I got an error in testing this and bug 32171 together. The error is due to a typo in 32171.
Nick, can you please check and explain a bit more about 32171?
32171 is updated - it is a separate issue, but hard to fix one without the other as you won't see the prices -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #143705|0 |1 is obsolete| | --- Comment #6 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 143916 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143916&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #143916|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 143953 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143953&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- This patch won't apply cleanly to 22.05.x but I know it is needed for 22.05.07. Please rebase! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Lucas Gass from comment #9)
This patch won't apply cleanly to 22.05.x but I know it is needed for 22.05.07. Please rebase!
I think the confusion is 29955 says it is in 22.05/x, but it isn't? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31569 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31569 [Bug 31569] Remove GetImportsRecordRange from acqui/addorderiso2709 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Nick Clemens from comment #10)
(In reply to Lucas Gass from comment #9)
This patch won't apply cleanly to 22.05.x but I know it is needed for 22.05.07. Please rebase!
I think the confusion is 29955 says it is in 22.05/x, but it isn't?
This depends on 31569 This was a tangle of confusion in fixing bugs, 32167 is needed for 22.05 - but this is not -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Bug 32166 depends on bug 31569, which changed state. Bug 31569 Summary: Remove GetImportsRecordRange from acqui/addorderiso2709 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31569 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32166 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36053 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36053 [Bug 36053] Replacement prices not populating when supplied from MarcItemFieldsToOrder -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org