Summary: | Koha/Items.t crashes on missing borrower 42 or 51 | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Architecture, internals, and plumbing | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | minor | ||
Priority: | P5 - low | CC: | fridolin.somers |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34932 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.05,22.11.11
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 34933 | ||
Attachments: |
Bug 34918: Fix hardcoded borrowernumber 42
Bug 34918: Fix hardcoded borrowernumber 42 Bug 34918: Fix userenv for safe_to_delete tests Bug 34918: Fix hardcoded borrowernumber 42 Bug 34918: Fix userenv for safe_to_delete tests |
Description
Marcel de Rooy
2023-09-26 14:21:40 UTC
Test::Builder::subtest(): DBI Exception: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_myclone`.`tmp_holdsqueue`, CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE) at /usr/share/perl/5.32/Test/More.pm line 809 Apart from a simple fix for 41, it also stumbles on a missing 51 later on for safe_to_delete. Can't call method "can_edit_items_from" on an undefined value at /usr/share/koha/Koha/Item.pm line 299. Created attachment 156234 [details] [review] Bug 34918: Fix hardcoded borrowernumber 42 Test plan: Run t/db_dependent/Koha/Item.t WIP: The problem with safe_to_delete must be solved too. Created attachment 156281 [details] [review] Bug 34918: Fix hardcoded borrowernumber 42 Test plan: Run t/db_dependent/Koha/Item.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 156282 [details] [review] Bug 34918: Fix userenv for safe_to_delete tests Instead of the fallback to 51, we pass a borrower that has permission for editing items. Test plan: Do not apply patch. Run test without a borrower 51 in db. (FAIL) Apply patch. Run test again. (PASS) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Trivial: Self SO. Created attachment 156382 [details] [review] Bug 34918: Fix hardcoded borrowernumber 42 Test plan: Run t/db_dependent/Koha/Item.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 156383 [details] [review] Bug 34918: Fix userenv for safe_to_delete tests Instead of the fallback to 51, we pass a borrower that has permission for editing items. Test plan: Do not apply patch. Run test without a borrower 51 in db. (FAIL) Apply patch. Run test again. (PASS) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Pushed to master for 23.11. Nice work everyone, thanks! Pushed to 23.05.x for 23.05.05 Nice work everyone! Pushed to oldstable for 22.11.x |