Bug 41121

Summary: Problem with OAI AutoUpdateSets during marc ordering process
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kkrueger, robin
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2025-10-28 12:05:52 UTC
After enabling AutoUpdateSets for OAI we started seeing random failures when the script tried to add orders to baskets:

{UNKNOWN}: Can't call method "items" on an undefined value at /usr/share/koha/lib/Koha/Biblio/Metadata.pm line 233. at /usr/share/koha/lib/C4/Biblio.pm line 318

We tracked it down to C4::OAI::Sets::UpdateOAISetsBiblio which received a null biblionumber, but we couldn't determine why.

As a workaround we disabled the update of sets during ordering, and the problem went away. Filing here in case someone else encounters this:
env "OVERRIDE_SYSPREF_OAI-PMH:AutoUpdateSets=0" perl $KOHA_CRON_PATH/marc_ordering_process.pl