[Bug 32154] New: Missing primary key on erm_user_roles table
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Bug ID: 32154 Summary: Missing primary key on erm_user_roles table Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Staff Client Assignee: koha-bugs@lists.koha-community.org Reporter: pedro.amorim@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com This is an outstanding issue related to the ERM module mentioned at: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32030#c31 Jonathan Druart: TestBuilder.t is failing on ERM::User::Roles, it's missing a primary key on erm_user_roles I think Can be tested with: use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new; my $m = 'Koha::ERM::UserRoles'; eval "require $m"; my $object = $builder->build_object( { class => $m } ); say ref($object); Should display "Koha::ERM::UserRole", not be empty -- 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=32154 --- Comment #1 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 143565 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143565&action=edit Bug 32154: Missing primary key on erm_user_roles table The aforementioned TestBuilder should display "Koha::ERM::UserRole", not be empty. This patch adds a primary key to the erm_user_roles table and fixes that. Also includes atomicupdate file to update database schema as well as updates to kohastructure.sql provided by Jonathan Druart. Looked into the vue files but didn't find anywhere or a need to include the new primary key in any of the requests as there is no request of users by role_user_id being made. Erm users are being created/updated as a relationship through licenceses/agreements. Furthermore, when editing a role of an existing user, this new primary key is already being supplied embeded in the license/agreement. -- 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=32154 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com, tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion -- 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=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff Keywords| |rel_22_11_candidate Severity|enhancement |normal Assignee|koha-bugs@lists.koha-commun |pjamorim91@gmail.com |ity.org | -- 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=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #143565|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 143620 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143620&action=edit Bug 32154: Missing primary key on erm_user_roles table The aforementioned TestBuilder should display "Koha::ERM::UserRole", not be empty. This patch adds a primary key to the erm_user_roles table and fixes that. Also includes atomicupdate file to update database schema as well as updates to kohastructure.sql provided by Jonathan Druart. Looked into the vue files but didn't find anywhere or a need to include the new primary key in any of the requests as there is no request of users by role_user_id being made. Erm users are being created/updated as a relationship through licenceses/agreements. Furthermore, when editing a role of an existing user, this new primary key is already being supplied embeded in the license/agreement. Test plan: Add users to license and agreement Run the cypress tests Confirm that the change fix the test that was failing in TestBuilder.t (another one may still fail however) Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32163 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32163 [Bug 32163] ErmUserRole has wrong koha_object[s]_class -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32030 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32030 [Bug 32030] Electronic resource management (ERM) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Just thinking about this one, it feels to me like it should be a multi-field primary key rather than a new field entirely. Having said that, it looks like we allow a user + licence + agreement combination to have multiple roles? That would mean having all four fields in the primary key... food for thought. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Martin Renvoize from comment #3)
Just thinking about this one, it feels to me like it should be a multi-field primary key rather than a new field entirely.
Having said that, it looks like we allow a user + licence + agreement combination to have multiple roles? That would mean having all four fields in the primary key... food for thought.
It's actually not possible, license_id and agreement_id are nullable and thus cannot be part of the primary key https://mariadb.com/kb/en/primary-keys-with-nullable-columns/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #143620|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 143773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143773&action=edit Bug 32154: Missing primary key on erm_user_roles table The aforementioned TestBuilder should display "Koha::ERM::UserRole", not be empty. This patch adds a primary key to the erm_user_roles table and fixes that. Also includes atomicupdate file to update database schema as well as updates to kohastructure.sql provided by Jonathan Druart. Looked into the vue files but didn't find anywhere or a need to include the new primary key in any of the requests as there is no request of users by role_user_id being made. Erm users are being created/updated as a relationship through licenceses/agreements. Furthermore, when editing a role of an existing user, this new primary key is already being supplied embeded in the license/agreement. Test plan: Add users to license and agreement Run the cypress tests Confirm that the change fix the test that was failing in TestBuilder.t (another one may still fail however) Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Ah yes, your right.. I'd completely missed the NULLable. Working as desired then.. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.field@ptfs-europe. | |com, | |pedro.amorim@ptfs-europe.co | |m Component|Staff Client |ERM QA Contact|testopia@bugs.koha-communit | |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ERM |Architecture, internals, | |and plumbing QA Contact| |testopia@bugs.koha-communit | |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_22_11_candidate |additional_work_needed --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This is missing the "DBIC changes" commit in master! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 144061 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144061&action=edit Bug 32154: Fix Agreements.t # Failed test at t/db_dependent/Koha/ERM/Agreements.t line 111. # Structures begin differing at: # $got->[0]{user_role_id} = '2' # $expected->[0]{user_role_id} = Does not exist # Looks like you failed 1 test of 4. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32267 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32267 [Bug 32267] Koha/ERM/Agreements.t is failing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #9)
Created attachment 144061 [details] [review] Bug 32154: Fix Agreements.t
# Failed test at t/db_dependent/Koha/ERM/Agreements.t line 111. # Structures begin differing at: # $got->[0]{user_role_id} = '2' # $expected->[0]{user_role_id} = Does not exist # Looks like you failed 1 test of 4.
Moved to bug 32267. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32154 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144061|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org