Bug 41417 - 500 error when creating new authorized values from additem.pl
Summary: 500 error when creating new authorized values from additem.pl
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-09 20:21 UTC by Lucas Gass (lukeg)
Modified: 2025-12-09 21:40 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41417: Fix client variable in cataloging.js (1.53 KB, patch)
2025-12-09 20:57 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41417: Fix client variable in cataloging.js (1.58 KB, patch)
2025-12-09 21:40 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2025-12-09 20:21:23 UTC
To recreate:

1. Find or create a record in Kkoha.
2. From the record detail page click "Edit" and "Manage items"
3. Begin adding a new item 
4. For any of the dropdowns that contain an authorized value ( LOST, DAMAGED, WITHDRAWN, CCODE, LOC ) click on the dropdown and begin typing an AV that doesn't exist.
5. You should see the text (select to create) appear, click it.
6. Now a modal appears "Create a new authorized value"
7. Fill out the required parts and click 'Save'.
8. Kaboom, 500 error:


Can't call method "metadata" on an undefined value at /kohadevbox/koha/cataloguing/additem.pl line 193
Comment 1 Lucas Gass (lukeg) 2025-12-09 20:57:55 UTC
Created attachment 190384 [details] [review]
Bug 41417: Fix client variable in cataloging.js

To test:
1. Find or create a record in Kkoha.
2. From the record detail page click "Edit" and "Manage items"
3. Begin adding a new item
4. For any of the dropdowns that contain an authorized value ( LOST, DAMAGED, WITHDRAWN, CCODE, LOC ) click on the dropdown and begin typing an AV that doesn't exist.
5. You should see the text (select to create) appear, click it.
6. Now a modal appears "Create a new authorized value"
7. Fill out the required parts and click 'Save'.
8. Kaboom, 500 error:
9. APPLY PATCH, clear browser cache.
10. Try again, this time it should work.
Comment 2 Roman Dolny 2025-12-09 21:40:29 UTC
Created attachment 190385 [details] [review]
Bug 41417: Fix client variable in cataloging.js

To test:
1. Find or create a record in Kkoha.
2. From the record detail page click "Edit" and "Manage items"
3. Begin adding a new item
4. For any of the dropdowns that contain an authorized value ( LOST, DAMAGED, WITHDRAWN, CCODE, LOC ) click on the dropdown and begin typing an AV that doesn't exist.
5. You should see the text (select to create) appear, click it.
6. Now a modal appears "Create a new authorized value"
7. Fill out the required parts and click 'Save'.
8. Kaboom, 500 error:
9. APPLY PATCH, clear browser cache.
10. Try again, this time it should work.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>