[Bug 21160] New: C4::Members loads and calls Koha::Schema directly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21160 Bug ID: 21160 Summary: C4::Members loads and calls Koha::Schema directly Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org I just noticed that C4::Members runs "use Koha::Schema" then calls Koha::Schema->resultset(‘Borrower’) in get_cardnumber_length(). Surely that should be calling Koha::Database->schema() and using $schema->resultset(‘Borrower’)? It’s the only place this happens in the entire codebase (introduced by https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15690 and then moved by a later commit), so I’m thinking it’s a bug. I don’t know that it would have a big impact on anything, but I figure it's worth raising an issue for it anyway. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21160 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- It means the same, but for consistency we could replace it yes. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21160 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #1)
It means the same, but for consistency we could replace it yes.
Cool. I'll replace it sometime. I'd argue that it's not quite the same. The main reason I was noticing it was because "use Koha::Schema" caused the schema to be loaded at compile time whereas using "use Koha::Database" meant it would load the schema at run time for a particular code path. I was getting the schema loaded even when I didn't need it. But that was for CGI. Wouldn't be an issue for Plack. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21160 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** This bug has been marked as a duplicate of bug 21015 *** -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org