https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41672 Bug ID: 41672 Summary: Use search()->next instead of find() when using other than primary key Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: johanna.raisa@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org The current code uses find() to look up records with a field other than the primary key. However, find() is intended only for primary key lookups and may not work as expected with other fields. To ensure correct and future-proof behavior, replace find() with search()->next when searching by non-primary key fields. For example, use: Koha::Checkouts->search({ itemnumber => $item->itemnumber })->next; instead of: Koha::Checkouts->find({ itemnumber => $item->itemnumber }); This change improves code reliability and compatibility with possible future schema changes. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.