Bug 29125

Summary: Use Koha::Patron object in C4:Utils::DataTables::Members.pm
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: PatronsAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30055
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 30060    
Bug Blocks:    
Attachments: Bug 29125: Add primary key to user_permissions table
Bug 29125: DBIC updates
Bug 29125: Use patron objects in C4::Utils::DataTables::Members.pm
Bug 29125: Fix 'Unknown column'

Description Nick Clemens (kidclamp) 2021-09-27 14:20:37 UTC
Currently we do a SQL search for patrons, then fetch the patron object for each borrowernumber individually, then fetch related objects

If we use Koha::Patrons directly we can prefetch related object and reduce the number of calls to the DB
Comment 1 Nick Clemens (kidclamp) 2021-09-27 18:38:16 UTC
Created attachment 125374 [details] [review]
Bug 29125: Add primary key to user_permissions table
Comment 2 Nick Clemens (kidclamp) 2021-09-27 18:38:19 UTC
Created attachment 125375 [details] [review]
Bug 29125: DBIC updates
Comment 3 Nick Clemens (kidclamp) 2021-09-27 18:38:22 UTC
Created attachment 125376 [details] [review]
Bug 29125: Use patron objects in C4::Utils::DataTables::Members.pm
Comment 4 Jonathan Druart 2021-10-08 14:38:27 UTC
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.`surname`' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 335

To recreate
/cgi-bin/koha/members/members-home.pl
Search for: "koh"
Search field: "surname"
Click "Search"
Comment 5 Jonathan Druart 2021-10-08 14:46:53 UTC
Created attachment 125979 [details] [review]
Bug 29125: Fix 'Unknown column'
Comment 6 Jonathan Druart 2022-02-09 09:37:15 UTC
Bug 30055 will make this bug obsolete.
Comment 7 Jonathan Druart 2022-02-09 12:52:56 UTC
I am going to move the following patch to bug 30060:
Bug 29125: Add primary key to user_permissions table
Comment 8 Jonathan Druart 2022-03-17 14:48:40 UTC

*** This bug has been marked as a duplicate of bug 30063 ***