Bug 10428: undefined check in add additem.pl
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 7 Jun 2013 08:17:54 +0000 (10:17 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 3 Jul 2013 11:30:38 +0000 (04:30 -0700)
commite31b158245f4eff36decebf30c8a87c8cfebe472
tree4233ef93d94dacb71cec8084ad38c1b7deb3f245
parent14babcecf681874e4a75eff0a5ba2d869f1966bf
Bug 10428: undefined check in add additem.pl

In additem.pl, in the code that generates item form you find:

@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)->subfield($subtag)));

This patch adds the check of $itemrecord->field($tag) undef.
I did not found a way to test it because item tag is always defined
when editing an item, but it would be safer/prettier to add this check.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passed-QA-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
cataloguing/additem.pl