|
Lines 81-87
Missing POD for new.
Link Here
|
| 81 |
sub new { |
81 |
sub new { |
| 82 |
my ( $class, $item_id ) = @_; |
82 |
my ( $class, $item_id ) = @_; |
| 83 |
my $type = ref($class) || $class; |
83 |
my $type = ref($class) || $class; |
| 84 |
my $item = Koha::Items->find( { barcode => barcodedecode($item_id) } ); |
84 |
|
|
|
85 |
# Return early if item_id is undefined, empty, or whitespace-only |
| 86 |
if ( !defined $item_id || $item_id eq '' || $item_id =~ /^\s*$/ ) { |
| 87 |
siplog( "LOG_DEBUG", "new ILS::Item: empty or undefined item_id" ); |
| 88 |
return; |
| 89 |
} |
| 90 |
|
| 91 |
my $decoded_barcode = barcodedecode($item_id); |
| 92 |
|
| 93 |
# Return early if barcode decoding results in empty value |
| 94 |
if ( !defined $decoded_barcode || $decoded_barcode eq '' ) { |
| 95 |
siplog( |
| 96 |
"LOG_DEBUG", |
| 97 |
"new ILS::Item('%s'): barcode decoding resulted in empty value - possible misconfiguration or faulty plugin", |
| 98 |
$item_id |
| 99 |
); |
| 100 |
return; |
| 101 |
} |
| 102 |
|
| 103 |
my $item = Koha::Items->find( { barcode => $decoded_barcode } ); |
| 85 |
unless ($item) { |
104 |
unless ($item) { |
| 86 |
siplog( "LOG_DEBUG", "new ILS::Item('%s'): not found", $item_id ); |
105 |
siplog( "LOG_DEBUG", "new ILS::Item('%s'): not found", $item_id ); |
| 87 |
warn "new ILS::Item($item_id) : No item '$item_id'."; |
106 |
warn "new ILS::Item($item_id) : No item '$item_id'."; |
| 88 |
- |
|
|