]> git.koha-community.org Git - koha.git/commit
Bug 20829: Handle non-existent barcode when linking to host item
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 30 May 2018 15:10:58 +0000 (12:10 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 14 Jun 2018 13:13:51 +0000 (15:13 +0200)
commit349da224b98e2efe2c259aa4d337ec3020316a7d
treef0f320270eddfc1539c7a2ef90c004d70111bf45
parenta56fea43cd819626121c05902d67fec5bf52d69b
Bug 20829: Handle non-existent barcode when linking to host item

Since commit 2c9aeb9b0f4449d1a25274b8fbf8dae4ec11d3bf
  Bug 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 commit b004818515a5b5fbc7748da614b758d1516c0ff2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
cataloguing/linkitem.pl