Bug 18277: [QA Follow-up] Additional polishing

Fix POD error in Biblio.pm, as reported by qa tools:
    Apparent command =cut not preceded by blank line

Resolve crash in t/db_dependent/Items/DelItem.t:
  Can't call method "biblio" on an undefined value at C4/Items.pm line 669.

Add find test in tools/batchMod.pl. Increase readability of map statement.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Marcel de Rooy 2017-07-07 09:55:54 +02:00 committed by Jonathan Druart
parent 98aaa69d38
commit 0c14a76049
3 changed files with 8 additions and 2 deletions

View File

@ -1442,6 +1442,7 @@ sub GetMarcPrice {
=head2 MungeMarcPrice
Return the best guess at what the actual price is from a price field.
=cut
sub MungeMarcPrice {

View File

@ -666,7 +666,7 @@ sub DelItem {
unless ($biblionumber) {
my $item = Koha::Items->find( $itemnumber );
$biblionumber = $item->biblio->biblionumber;
$biblionumber = $item ? $item->biblio->biblionumber : undef;
}
# If there is no biblionumber for the given itemnumber, there is nothing to delete

View File

@ -125,7 +125,12 @@ if ($op eq "action") {
my @simple_items_display = map {
my $itemnumber = $_;
my $item = Koha::Items->find($itemnumber);
{ itemnumber => $itemnumber, barcode => ($item->barcode || q||), biblionumber => $item->biblio->biblionumber }} @itemnumbers;
{
itemnumber => $itemnumber,
barcode => $item ? ( $item->barcode // q{} ) : q{},
biblionumber => $item ? $item->biblio->biblionumber : q{},
};
} @itemnumbers;
$template->param("simple_items_display" => \@simple_items_display);
}