3 # Copyright 2016 Koha Development team
5 # This file is part of Koha
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 use Test::More tests => 10;
28 use Koha::Item::Transfer::Limits;
32 use t::lib::TestBuilder;
35 my $schema = Koha::Database->new->schema;
36 $schema->storage->txn_begin;
38 my $dbh = C4::Context->dbh;
40 my $builder = t::lib::TestBuilder->new;
41 my $library = $builder->build( { source => 'Branch' } );
42 my $nb_of_items = Koha::Items->search->count;
43 my $biblio = $builder->build_sample_biblio();
44 my $new_item_1 = $builder->build_sample_item({
45 biblionumber => $biblio->biblionumber,
46 homebranch => $library->{branchcode},
47 holdingbranch => $library->{branchcode},
49 my $new_item_2 = $builder->build_sample_item({
50 biblionumber => $biblio->biblionumber,
51 homebranch => $library->{branchcode},
52 holdingbranch => $library->{branchcode},
56 t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} });
58 like( $new_item_1->itemnumber, qr|^\d+$|, 'Adding a new item should have set the itemnumber' );
59 is( Koha::Items->search->count, $nb_of_items + 2, 'The 2 items should have been added' );
61 my $retrieved_item_1 = Koha::Items->find( $new_item_1->itemnumber );
62 is( $retrieved_item_1->barcode, $new_item_1->barcode, 'Find a item by id should return the correct item' );
64 subtest 'get_transfer' => sub {
67 my $transfer = $new_item_1->get_transfer();
68 is( $transfer, undef, 'Koha::Item->get_transfer should return undef if the item is not in transit' );
70 my $library_to = $builder->build( { source => 'Branch' } );
72 C4::Circulation::transferbook( $library_to->{branchcode}, $new_item_1->barcode );
74 $transfer = $new_item_1->get_transfer();
75 is( ref($transfer), 'Koha::Item::Transfer', 'Koha::Item->get_transfer should return a Koha::Item::Transfers object' );
77 is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer should return a valid Koha::Item::Transfers object' );
80 subtest 'holds' => sub {
83 my $biblio = $builder->build_sample_biblio();
84 my $item = $builder->build_sample_item({
85 biblionumber => $biblio->biblionumber,
88 is($item->holds->count, 0, "Nothing returned if no holds");
89 my $hold1 = $builder->build({ source => 'Reserve', value => { itemnumber=>$item->itemnumber, found => 'T' }});
90 my $hold2 = $builder->build({ source => 'Reserve', value => { itemnumber=>$item->itemnumber, found => 'W' }});
91 my $hold3 = $builder->build({ source => 'Reserve', value => { itemnumber=>$item->itemnumber, found => 'W' }});
93 is($item->holds()->count,3,"Three holds found");
94 is($item->holds({found => 'W'})->count,2,"Two waiting holds found");
95 is_deeply($item->holds({found => 'T'})->next->unblessed,$hold1,"Found transit holds matches the hold");
96 is($item->holds({found => undef})->count, 0,"Nothing returned if no matching holds");
99 subtest 'biblio' => sub {
102 my $biblio = $retrieved_item_1->biblio;
103 is( ref( $biblio ), 'Koha::Biblio', 'Koha::Item->biblio should return a Koha::Biblio' );
104 is( $biblio->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblio should return the correct biblio' );
107 subtest 'biblioitem' => sub {
110 my $biblioitem = $retrieved_item_1->biblioitem;
111 is( ref( $biblioitem ), 'Koha::Biblioitem', 'Koha::Item->biblioitem should return a Koha::Biblioitem' );
112 is( $biblioitem->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblioitem should return the correct biblioitem' );
115 subtest 'checkout' => sub {
117 my $item = Koha::Items->find( $new_item_1->itemnumber );
119 my $checkout = $item->checkout;
120 is( $checkout, undef, 'Koha::Item->checkout should return undef if there is no current checkout on this item' );
123 my $patron = $builder->build({ source => 'Borrower' });
124 C4::Circulation::AddIssue( $patron, $item->barcode );
125 $checkout = $retrieved_item_1->checkout;
126 is( ref( $checkout ), 'Koha::Checkout', 'Koha::Item->checkout should return a Koha::Checkout' );
127 is( $checkout->itemnumber, $item->itemnumber, 'Koha::Item->checkout should return the correct checkout' );
128 is( $checkout->borrowernumber, $patron->{borrowernumber}, 'Koha::Item->checkout should return the correct checkout' );
131 C4::Circulation::AddReturn( $item->barcode );
133 # There is no more checkout on this item, making sure it will not return old checkouts
134 $checkout = $item->checkout;
135 is( $checkout, undef, 'Koha::Item->checkout should return undef if there is no *current* checkout on this item' );
138 subtest 'can_be_transferred' => sub {
141 t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
142 t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
144 my $biblio = $builder->build_sample_biblio();
145 my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
146 my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
147 my $item = $builder->build_sample_item({
148 biblionumber => $biblio->biblionumber,
149 homebranch => $library1->branchcode,
150 holdingbranch => $library1->branchcode,
154 is(Koha::Item::Transfer::Limits->search({
155 fromBranch => $library1->branchcode,
156 toBranch => $library2->branchcode,
157 })->count, 0, 'There are no transfer limits between libraries.');
158 ok($item->can_be_transferred({ to => $library2 }),
159 'Item can be transferred between libraries.');
161 my $limit = Koha::Item::Transfer::Limit->new({
162 fromBranch => $library1->branchcode,
163 toBranch => $library2->branchcode,
164 itemtype => $item->effective_itemtype,
166 is(Koha::Item::Transfer::Limits->search({
167 fromBranch => $library1->branchcode,
168 toBranch => $library2->branchcode,
169 })->count, 1, 'Given we have added a transfer limit,');
170 is($item->can_be_transferred({ to => $library2 }), 0,
171 'Item can no longer be transferred between libraries.');
172 is($item->can_be_transferred({ to => $library2, from => $library1 }), 0,
173 'We get the same result also if we pass the from-library parameter.');
176 $retrieved_item_1->delete;
177 is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
179 $schema->storage->txn_rollback;
181 subtest 'pickup_locations' => sub {
184 $schema->storage->txn_begin;
187 Koha::Holds->search->delete;
188 Koha::Patrons->search->delete;
189 Koha::Items->search->delete;
190 Koha::Libraries->search->delete;
191 $dbh->do('DELETE FROM issues');
192 $dbh->do('DELETE FROM issuingrules');
194 q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
195 VALUES (?, ?, ?, ?)},
199 $dbh->do('DELETE FROM branch_item_rules');
200 $dbh->do('DELETE FROM default_branch_circ_rules');
201 $dbh->do('DELETE FROM default_branch_item_rules');
202 $dbh->do('DELETE FROM default_circ_rules');
204 my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
205 my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
207 my $library1 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
208 my $library2 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
209 my $library3 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 0 } } );
210 my $library4 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
212 my $group1_1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library1->branchcode } } );
213 my $group1_2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library2->branchcode } } );
215 my $group2_1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library3->branchcode } } );
216 my $group2_2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library4->branchcode } } );
218 my $biblioitem = $builder->build( { source => 'Biblioitem' } );
220 my $item1 = Koha::Item->new({
221 biblionumber => $biblioitem->{biblionumber},
222 biblioitemnumber => $biblioitem->{biblioitemnumber},
223 homebranch => $library1->branchcode,
224 holdingbranch => $library2->branchcode,
226 barcode => "item1barcode",
229 my $item3 = Koha::Item->new({
230 biblionumber => $biblioitem->{biblionumber},
231 biblioitemnumber => $biblioitem->{biblioitemnumber},
232 homebranch => $library3->branchcode,
233 holdingbranch => $library4->branchcode,
235 barcode => "item3barcode",
238 my $patron1 = $builder->build_object( { class => 'Koha::Patrons', value => { branchcode => $library1->branchcode } } );
239 my $patron4 = $builder->build_object( { class => 'Koha::Patrons', value => { branchcode => $library4->branchcode } } );
241 t::lib::Mocks::mock_preference('HomeOrHoldingBranch', 'homebranch');
243 #Case 1: holdallowed any, hold_fulfillment_policy any
245 q{INSERT INTO default_circ_rules (holdallowed, hold_fulfillment_policy, returnbranch)
251 my @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
252 my @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
253 my @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
254 my @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
256 ok(scalar(@pl_1_1) == scalar(@pl_1_4) && scalar(@pl_1_1) == scalar(@pl_3_1) && scalar(@pl_1_1) == scalar(@pl_3_4), 'All combinations of patron/item renders the same number of locations');
258 #Case 2: holdallowed homebranch, hold_fulfillment_policy any, HomeOrHoldingBranch 'homebranch'
260 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
265 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
266 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
267 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
268 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
270 ok(scalar(@pl_1_1) == 3, 'Pickup location for patron 1 and item 1 renders all libraries that are pickup_locations');
271 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_3_4) == 0, 'Any other combination renders no locations');
273 #Case 3: holdallowed holdgroup, hold_fulfillment_policy any
275 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
280 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
281 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
282 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
283 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
285 ok(scalar(@pl_1_1) == 3, 'Pickup location for patron 1 and item 1 renders all libraries that are pickup_locations');
286 ok(scalar(@pl_3_4) == 3, 'Pickup location for patron 4 and item 3 renders all libraries that are pickup_locations');
287 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0, 'Any other combination renders no locations');
289 #Case 4: holdallowed any, hold_fulfillment_policy holdgroup
291 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
296 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
297 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
298 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
299 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
301 ok(scalar(@pl_1_1) == 2 && scalar(@pl_1_4) == 2, 'Pickup locations for item 1 renders all libraries in items\'s holdgroup that are pickup_locations');
302 ok(scalar(@pl_3_1) == 1 && scalar(@pl_3_4) == 1, 'Pickup locations for item 3 renders all libraries in items\'s holdgroup that are pickup_locations');
304 #Case 5: holdallowed homebranch, hold_fulfillment_policy holdgroup, HomeOrHoldingBranch 'homebranch'
306 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
311 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
312 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
313 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
314 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
316 ok(scalar(@pl_1_1) == 2, 'Pickup location for patron 1 and item 1 renders all libraries in holdgroup that are pickup_locations');
317 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_3_4) == 0, 'Any other combination renders no locations');
319 #Case 6: holdallowed holdgroup, hold_fulfillment_policy holdgroup
321 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
326 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
327 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
328 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
329 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
331 ok(scalar(@pl_1_1) == 2, 'Pickup location for patron 1 and item 1 renders all libraries that are pickup_locations');
332 ok(scalar(@pl_3_4) == 1, 'Pickup location for patron 4 and item 3 renders all libraries that are pickup_locations');
333 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0, 'Any other combination renders no locations');
335 #Case 7: holdallowed any, hold_fulfillment_policy homebranch
337 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
342 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
343 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
344 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
345 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
347 ok(scalar(@pl_1_1) == 1 && scalar(@pl_1_4) == 1 && $pl_1_1[0]->{branchcode} eq $library1->branchcode && $pl_1_4[0]->{branchcode} eq $library1->id, 'Pickup locations for item 1 renders item\'s homelibrary');
348 ok(scalar(@pl_3_1) == 0 && scalar(@pl_3_4) == 0, 'Any other combination renders no locations, because library3 is not pickup_location');
350 #Case 8: holdallowed homebranch, hold_fulfillment_policy homebranch, HomeOrHoldingBranch 'homebranch'
352 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
357 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
358 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
359 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
360 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
362 ok(scalar(@pl_1_1) == 1 && $pl_1_1[0]->{branchcode} eq $library1->branchcode, 'Pickup location for patron 1 and item 1 renders item\'s homebranch');
363 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_3_4) == 0, 'Any other combination renders no locations');
365 #Case 9: holdallowed holdgroup, hold_fulfillment_policy homebranch
367 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
372 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
373 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
374 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
375 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
377 ok(scalar(@pl_1_1) == 1, 'Pickup location for patron 1 and item 1 renders item\'s homebranch');
378 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_3_4) == 0, 'Any other combination renders no locations');
380 #Case 10: holdallowed any, hold_fulfillment_policy holdingbranch
382 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
387 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
388 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
389 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
390 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
392 ok(scalar(@pl_1_1) == 1 && scalar(@pl_1_4) == 1 && $pl_1_1[0]->{branchcode} eq $library2->branchcode && $pl_1_4[0]->{branchcode} eq $library2->branchcode, 'Pickup locations for item 1 renders item\'s holding branch');
393 ok(scalar(@pl_3_1) == 1 && scalar(@pl_3_4) == 1 && $pl_3_1[0]->{branchcode} eq $library4->branchcode && $pl_3_4[0]->{branchcode} eq $library4->branchcode, 'Pickup locations for item 3 renders item\'s holding branch');
396 #Case 11: holdallowed homebranch, hold_fulfillment_policy holdingbranch, HomeOrHoldingBranch 'homebranch'
398 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
403 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
404 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
405 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
406 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
408 ok(scalar(@pl_1_1) == 1 && $pl_1_1[0]->{branchcode} eq $library2->branchcode, 'Pickup location for patron 1 and item 1 renders item\'s holding branch');
409 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_3_4) == 0, 'Any other combination renders no locations');
411 #Case 12: holdallowed holdgroup, hold_fulfillment_policy holdingbranch
413 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
418 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
419 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
420 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
421 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
423 ok(scalar(@pl_1_1) == 1 && $pl_1_1[0]->{branchcode} eq $library2->branchcode, 'Pickup location for patron 1 and item 1 renders item\'s holding branch');
424 ok(scalar(@pl_3_4) == 1 && $pl_3_4[0]->{branchcode} eq $library4->branchcode, 'Pickup location for patron 4 and item 3 renders item\'s holding branch');
425 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0, 'Any other combination renders no locations');
427 t::lib::Mocks::mock_preference('HomeOrHoldingBranch', 'holdingbranch');
429 #Case 13: holdallowed homebranch, hold_fulfillment_policy any, HomeOrHoldingBranch 'holdingbranch'
431 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
436 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
437 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
438 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
439 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
441 ok(scalar(@pl_3_4) == 3, 'Pickup location for patron 4 and item 3 renders all libraries that are pickup_locations');
442 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_1_1) == 0, 'Any other combination renders no locations');
444 #Case 14: holdallowed homebranch, hold_fulfillment_policy holdgroup, HomeOrHoldingBranch 'holdingbranch'
446 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
451 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
452 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
453 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
454 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
456 ok(scalar(@pl_3_4) == 1, 'Pickup location for patron 4 and item 3 renders all libraries in holdgroup that are pickup_locations');
457 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_1_1) == 0, 'Any other combination renders no locations');
459 #Case 15: holdallowed homebranch, hold_fulfillment_policy homebranch, HomeOrHoldingBranch 'holdingbranch'
461 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
466 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
467 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
468 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
469 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
471 #ok(scalar(@pl_3_4) == 1 && $pl_3_4[0]->{branchcode} eq $library4->branchcode, 'Pickup location for patron 4 and item 3 renders item\'s holding branch');
472 ok(scalar(@pl_3_4) == 0 && scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_1_1) == 0, 'Any combination of patron/item renders no locations');
474 #Case 16: holdallowed homebranch, hold_fulfillment_policy holdingbranch, HomeOrHoldingBranch 'holdingbranch'
476 q{UPDATE default_circ_rules set holdallowed = ?, hold_fulfillment_policy = ?},
481 @pl_1_1 = $item1->pickup_locations( { patron => $patron1 } );
482 @pl_1_4 = $item1->pickup_locations( { patron => $patron4 } );
483 @pl_3_1 = $item3->pickup_locations( { patron => $patron1 } );
484 @pl_3_4 = $item3->pickup_locations( { patron => $patron4 } );
486 ok(scalar(@pl_3_4) == 1 && $pl_3_4[0]->{branchcode} eq $library4->branchcode, 'Pickup location for patron 1 and item 1 renders item\'s holding branch');
487 ok(scalar(@pl_1_4) == 0 && scalar(@pl_3_1) == 0 && scalar(@pl_1_1) == 0, 'Any other combination renders no locations');
489 $schema->storage->txn_rollback;