| Summary: | Error 500 on OPAC on recently edited records | ||
|---|---|---|---|
| Product: | Koha | Reporter: | José Anjos <joseanjos> |
| Component: | Searching | Assignee: | Bugs List <koha-bugs> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | synapse.ova |
| Version: | 22.11 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| 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: | |||
|
Description
José Anjos
2023-06-12 10:15:26 UTC
If I delete all Items, the search in OPAC works. If I add the Item, the error 500 come again. After some more tests... The problem is the field: 995$o Circulation type (not for loan) items.notforloan connected to Authorized values for category: NOT_LOAN I have to edit the Item, clean the field and save. Then the search on OPAC is OK. Your items are missing mandatory fields. You need to make sure that all of these are set in all your items: 952$a items.homebranch 952$b items.holdingbranch 952$y items.itype Koha won't function correctly if any of these are missing. Hm if you are UNIMARC other MARC fields apply (missed that you wrote you have 995) If you edit an item, you might not see if the field is empty (defaults might apply). Better probably to double check using SQL/reports. This points to an issue with the branch: AH01215: DBIC result _type isn't of the _type Branch at /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl line 678.: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl Katrin Fischer, thank you for your help. It seams that was missing Holding Branch on that Items. Its strange because if I edited any record and just save it, without doing any change, that Item would give a Error 500 on OPAC search. Now (maybe since 23.05 or restart) that problem stopped. Our library had same problem after upgrading to Koha 23.05. Thank you for pointing the reason for such a problem. -- Diagnosing the problem -- Run SQL queries: SELECT holdingbranch, count(*) FROM items GROUP BY holdingbranch; SELECT homebranch, count(*) FROM items GROUP BY homebranch; — there should be no NULL records -- Solving the problem -- If you have just one library it is easy to solve the problem with the following SQL queries (change LIBCODE with your library code): UPDATE items SET homebranch = "LIBCODE" WHERE homebranch IS NULL; UPDATE items SET holdingbranch = "LIBCODE" WHERE holdingbranch IS NULL; -- Securing from future problems -- Edit MARC frameworks and make subfields with Koha connection items.homebranch, items.holdingbranch, items.itype mandatory. Subfields for MARC21 are provided above. For UNIMARC these are probably 995$b, 995$c, 995$r (at least in our case) Similar queries could be added to Koha health check to show possible problems in DB |