Koha-clms/acqui
Kyle M Hall e134b6768b 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>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2e5f4af839)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-01-19 13:32:57 +01:00
..
pdfformat Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
acqui-home.pl Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch 2016-09-08 14:36:04 +00:00
add_user_search.pl Bug 15758: Koha::Libraries - Remove GetBranches 2016-09-08 14:36:03 +00:00
addorder.pl Bug 13321: use the populate_with_prices where needed 2016-10-28 13:46:06 +00:00
addorderiso2709.pl Bug 19813: Make MarcItemFieldsToOrder handle non-existing tags 2018-01-19 13:32:57 +01:00
ajax-getauthvaluedropbox.pl Bug 17847: Replace C4::Koha::GetAuthvalueDropbox with Koha::AuthorisedValues 2017-03-31 10:12:37 +00:00
basket.pl Bug 19180: [FOLLOW-UP] Renaming all instances of 'name' variable to 'booksellername' 2017-10-23 17:02:14 +02:00
basketgroup.pl Bug 19332 - Basket grouping PDF and CSV exports empty 2017-09-19 16:28:28 +02:00
basketheader.pl Bug 19195: Do not explicitely force scalar context when unecessary 2017-10-27 10:01:00 +02:00
booksellers.pl Bug 19130: (followup) Controller scripts should preserve behaviour 2017-09-29 15:21:57 +02:00
cancelorder.pl Bug 7162: Factorize code for order cancellation (QA fixes) 2014-10-30 00:44:16 -03:00
check_budget_total.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
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 18471 - Receiving order with unitprice greater than 1000 processing incorrectly 2017-04-28 06:27:51 -04: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 2018-01-15 16:45:53 +01:00
invoices.pl Bug 19130: (followup) Controller scripts should preserve behaviour 2017-09-29 15:21:57 +02: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 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
neworderempty.pl Bug 18432 : Follow up - Updating to use they/them 2017-04-21 10:56:43 -04: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 19194: Check itemtype is defined when receiving an order 2017-09-12 16:36:10 +02:00
parcel.pl Bug 18432: code comments assume male gender 2017-04-21 10:56:43 -04: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-09-29 15:21:57 +02:00
uncertainprice.pl Bug 11122 - publisher code and publication year not fetched in acq orders 2017-06-09 15:15:50 +02:00
updatesupplier.pl Bug 18716: Remove CGI::param warns from updatesupplier.pl 2017-06-12 12:32:47 +02:00
z3950_search.pl Bug 19372: (bug 15801 follow-up) pass selected frameworkcode to the template 2017-10-17 10:14:21 +02:00