Bug 28846

Summary: MarcRecordFromNewSuggestion needs mapping to biblioitems.itemtype
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
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 Fridolin Somers 2021-08-12 01:18:57 UTC
In C4::Suggestions, MarcRecordFromNewSuggestion uses mapping to biblioitems.itemtype :
https://git.koha-community.org/Koha-community/Koha/src/commit/e9428f662fe2ec0271878ec78886e7f95a25a9e1/C4/Suggestions.pm#L614

But this Koha to MARC mapping may not exists when itemtype is on item level.
Same for biblio.autor, even if unlikely.
Comment 1 Katrin Fischer 2022-07-16 11:58:55 UTC
Libraries using item-level itypes usually still have the mapping on record level, although they might set it to be not mandatory in cataloguing. There is a lot of functionality tied to the record level itype, even when using item level itypes, so both make sense to have.

biblio.author should also exist.

Is this to avoid an explosion if the mapping doesn't exist?

I tried to remove both and create a record from a suggestion:

* Administration > Kohat-to-MARC-Mapping, unmap biblio.author and biblioitems.itemtype (not a good idea, but for testing)
* Add a new suggestion > BOOM!

Tag "" is not a valid tag. at /kohadevbox/koha/C4/Suggestions.pm line 492.

This is actually odd, because creating a suggestions doens't create a MARC record yet.

Is this a non-fix if mappings are also required in other places or an even bigger issue?