Bug 12264: [QA Follow-up] Fixing biblionumber/biblioitemnumber mixup
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 10 Nov 2014 08:21:46 +0000 (09:21 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 10 Nov 2014 15:00:22 +0000 (12:00 -0300)
commit5b0b78c316cea614a7a4104a4883958c0b995bef
treefc95cdddcef586a26477d2ece740c11b9e6c7c9e
parent3740b2684cb1837bedec99ab43eaa1eff29e13e0
Bug 12264: [QA Follow-up] Fixing biblionumber/biblioitemnumber mixup

While testing the string change on 12264, I had this result:
DBD::mysql::st execute failed: Column 'biblioitemnumber' cannot be null at /usr/share/koha/testclone/C4/Items.pm line 2191.
DBD::mysql::st execute failed: Column 'biblioitemnumber' cannot be null at /usr/share/koha/testclone/C4/Items.pm line 2191.
    # Child (GetItemsInfo tests) exited without calling finalize()
not ok 4 - GetItemsInfo tests

This was caused by this line in the unit test:
 my $biblionumber = get_biblio();
This routine returns:
    return ($bibnum, $bibitemnum);
So instead of the bibnum the bibitemnum is saved in biblionumber.
In my test database bibnum and bibitemnum somehow got out of sync, revealing
this bug :)
The fix is just adding parentheses:
 my ( $biblionumber ) = get_biblio();

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
t/db_dependent/Items.t