Bug 6866

Summary: Accessing 'additem.pl' with no CGI params causes error
Product: Koha Reporter: Robin Sheat <robin>
Component: CatalogingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: minor    
Priority: P5 - low CC: koha.sekjal
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Robin Sheat 2011-09-13 04:03:08 UTC
If you access /cgi-bin/koha/cataloguing/additem.pl directly, you get:

Can't call method "fields" on an undefined value at /mnt/catalyst/koha/C4/Biblio.pm line 2133.

This is in the 'TransformMarcToKoha' function, which is called from additem.pl. It should probably do something sensible (redirect to the main cataloguing page?) if there is no record found from the supplied biblionumber.

This can happen, for example, if you change libraries when on the additem page.
Comment 1 Katrin Fischer 2019-05-04 11:03:32 UTC
This is still valid:

Can't call method "fields" on an undefined value at /home/vagrant/kohaclone/cataloguing/additem.pl line 752

Would be nice to catch this and display a human-friendlier error.
Comment 2 Owen Leonard 2020-09-14 14:22:37 UTC
This appears to have been fixed.