Bug 40634

Summary: Adding new authorized value whilst using item edit form creates an error
Product: Koha Reporter: Andrew Auld <andrew.auld>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: m.de.rooy
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Andrew Auld 2025-08-11 16:39:53 UTC
In the staff side, when using the edit item form, the ability to add a new authorized value, for example a new Shelving Location, or a new Collection Code doesn't work.
This is the resultant error:
Can't call method "metadata" on an undefined value at /kohadevbox/koha/cataloguing/additem.pl line 193.

To reproduce the bug:
1) find a bib record with an item
2) edit the item (/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=XXX&itemnumber=YYY)
3) in the shelving location field, hit the down arrow and type a new shelving location.
4) hit 'select to create' and add further details in the pop up.
5) hit 'save'
6) enjoy the error!