Bug 20829: Handle non-existent barcode when linking to host item
Since commit2c9aeb9b0fBug 18277: Remove GetBiblionumberFromItemnumber - linkitem $item is not defined if the barcode is invalid, we should not call method on it in that case. Test plan: - Turn on EasyAnalyticalRecords - Go to a detail page - Edit > Link to host item - Enter an invalid barcode => With the patch you get a friendly error message => Without this patch it explodes with Can't call method "itemnumber" on an undefined value at /home/vagrant/kohaclone/cataloguing/linkitem.pl line 86. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commitb004818515) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
a56fea43cd
commit
349da224b9
|
|
@ -74,6 +74,9 @@ if ( $barcode && $biblionumber ) {
|
|||
errornomodbiblio => 1
|
||||
);
|
||||
}
|
||||
$template->param(
|
||||
hostitemnumber => $item->itemnumber,
|
||||
);
|
||||
}
|
||||
else {
|
||||
$template->param(
|
||||
|
|
@ -84,7 +87,6 @@ if ( $barcode && $biblionumber ) {
|
|||
|
||||
$template->param(
|
||||
barcode => $barcode,
|
||||
hostitemnumber => $item->itemnumber,
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue