Koha/acqui
Kyle M Hall edcf4af095 Bug 19813: Make MarcItemFieldsToOrder handle non-existing tags
MarcItemFieldsToOrder defines how Koha looks at tags in order records to generate item data.

Let's look at a simplified case:
homebranch: 955$a
holdingbranch: 956$a

So, here we are looking at 955 for the home branch, and 956 for the holding branch. So, it should make sense that Koha requires that these fields exist in equal number in the record. That is, for each 955, there should be a corresponding 956.

Let's look at a different case:
homebranch: 946$a|975$a
holdingbranch: 946$a|975$a

In this case, we are using the fallback behavior. VendorA stores the branch data in 946, and VendorB stores it in 975. This seems like it would work, but it won't! That's because Koha is expecting there to be the same number of 946's as there are 975's! In reality, the VendorA records will have a number of 946's, and *zero* 975's. The inverse will be true for VendorB.

Koha should be able to skip those tags that simply don't exist in the record.

Test Plan:
1) Set MarcItemFieldsToOrder to something like:
homebranch: 946$a|975$a
holdingbranch: 946$a|975$a
budget_code: 946$f|975$f
itype: 946$y|975$y
notforloan: 946$l|975$l
ccode: 946$t|975$c
quantity: 946$q|975$q
price: 946$p|975$p
itemcallnumber: 946$n|975$n
loc: 946$c|975$t
2) Create a record using only the 975 tag for item building data
3) Import the record into Koha
4) Create a basket
5) Attempt to add the record to the basket
6) Note the unequal fields error
7) Apply this patch
8) Reload the page
9) No error!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marci Chen <mchen@mckinneytexas.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Fix typo occurrance and theses.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-22 13:15:35 -03:00
..
pdfformat Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
acqui-home.pl Bug 17829: Move GetMember to Koha::Patron 2017-07-10 13:14:19 -03:00
add_user_search.pl Bug 15758: Koha::Libraries - Remove GetBranches 2016-09-08 14:36:03 +00:00
addorder.pl Bug 15685: (QA follow-up) Fix qa script errors 2017-10-11 13:08:42 -03:00
addorderiso2709.pl Bug 19813: Make MarcItemFieldsToOrder handle non-existing tags 2017-12-22 13:15:35 -03:00
ajax-getauthvaluedropbox.pl Bug 17847: Replace C4::Koha::GetAuthvalueDropbox with Koha::AuthorisedValues 2017-03-31 10:12:37 +00:00
basket.pl Bug 19200: (QA follow-up) Simplify call to GetBasketAsCSV 2017-12-22 13:15:35 -03:00
basketgroup.pl Bug 19332 - Basket grouping PDF and CSV exports empty 2017-09-19 11:47:33 -03:00
basketheader.pl Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket 2017-10-11 13:06:06 -03:00
booksellers.pl Bug 19130: (followup) Controller scripts should preserve behaviour 2017-08-25 11:53:44 -03:00
cancelorder.pl Bug 13208: [FOLLOW-UP] Creating and implementing new Koha::Acquisition::Basket[s] modules 2017-10-09 14:00:58 -03:00
check_budget_total.pl
check_duplicate_barcode_ajax.pl Bug 16154: CGI->multi_param - Declare a list 2016-04-26 23:16:42 +00:00
check_uniqueness.pl Bug 16154: CGI->multi_param - Declare a list 2016-04-26 23:16:42 +00:00
edi_ean.pl Bug 7736: Support Ordering via Edifact EDI messages 2016-04-01 20:03:17 +00:00
edifactmsgs.pl Bug 17081 Incorrect comparison operator used in edifactmsgs.pl 2016-08-10 14:03:37 +00:00
edimsg.pl Bug 7736: Support Ordering via Edifact EDI messages 2016-04-01 20:03:17 +00:00
finishreceive.pl Bug 15685: (QA follow-up) Fix typo 2017-10-11 13:08:46 -03:00
histsearch.pl Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch 2016-09-08 14:36:04 +00:00
invoice-files.pl Bug 16154: CGI->multi_param - Force scalar context 2016-04-26 23:16:43 +00:00
invoice.pl Bug 19694: Force scalar context for output_pref called with billingdate 2017-12-21 13:10:44 -03:00
invoices.pl Bug 19130: (followup) Controller scripts should preserve behaviour 2017-08-25 11:53:44 -03:00
lateorders-export.pl Bug 16154: CGI->multi_param - Declare a list 2016-04-26 23:16:42 +00:00
lateorders.pl Bug 14535: Update the supplier filter too 2017-03-31 12:38:44 +00:00
modordernotes.pl Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
neworderbiblio.pl Bug 17182: (QA follow-up) Fix call to GetMarcBiblio 2017-12-11 14:30:43 -03:00
neworderempty.pl Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket 2017-10-11 13:06:06 -03:00
newordersubscription.pl Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
newordersuggestion.pl Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
ordered.pl Bug 17771: Add link to bibliographic record on spent/ordered lists in acquisitions 2017-01-19 11:44:29 +00:00
orderreceive.pl Bug 15685: (follow-up) K:A:O->find and ->fetch are no longer used 2017-10-11 13:08:46 -03:00
parcel.pl Bug 19596: Don't try to get hold or items count for non-existent biblios 2017-11-26 12:59:55 -03:00
parcels.pl Bug 18432: code comments assume male gender 2017-04-21 10:56:43 -04:00
spent.pl Bug 17771: aqorders.biblionumber was already part of the query 2017-01-19 12:00:16 +00:00
supplier.pl Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
transferorder.pl Bug 19130: (followup) Controller scripts should preserve behaviour 2017-08-25 11:53:44 -03:00
uncertainprice.pl Bug 19695: Fix another instance of ->find in list context (uncertainprice.pl) 2017-11-27 14:24:04 -03:00
updatesupplier.pl Bug 18716: Remove CGI::param warns from updatesupplier.pl 2017-06-09 11:57:00 -03:00
z3950_search.pl Bug 19372: (bug 15801 follow-up) pass selected frameworkcode to the template 2017-09-29 12:36:59 -03:00