[Koha-bugs] [Bug 35836] search_for_data_inconsistencies.pl - Search for loops in dependencies.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 18 19:06:21 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35836

--- Comment #26 from Matthias Le Gac <matthias.le-gac at inlibro.com> ---
Created attachment 163368
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163368&action=edit
Bug 35836: change | by , for the print

We have guarantors who guarantee individuals who are, in turn, their
guarantors. 
It is not clear if this should be allowed (bz35421), but it works, and has been
working for a while.
However, it breaks with bz12532, which produces a recursion that disrupts
everything.
Creation of a code in search_for_data_inconsistencies.pl that identifies loops
in borrower_relationships. This must work in both directions for validation.

This is the first bz I've made. Here's the test plan, let me know if there's
anything to improve.

Test Plan:

1 - Apply the patch.
2 - Create 4 different adult users.
3 - In the terminal, navigate to the database.
4 - Insert relationships into the "borrower_relationships" table:
        - Example: INSERT INTO borrower_relationships (id, guarantor_id,
guarantee_id, relationship) VALUES (1, 52, 53, 'father');
                   INSERT INTO borrower_relationships (id, guarantor_id,
guarantee_id, relationship) VALUES (2, 53, 54, 'father');
                   INSERT INTO borrower_relationships (id, guarantor_id,
guarantee_id, relationship) VALUES (3, 54, 52, 'father');
        - Ensure that the relationships created form a loop of guarantors.
5 - In the terminal, navigate to your Koha environment's git repository.
6 - Change directory to "cd misc/maintenance."
7 - Run the script to detect guarantor loops:
./search_for_data_inconsistencies.pl
8 - Verify that the output provides the borrower IDs involved in the guarantor
loop.

*Have fun creating intricate relationships to test the script's limit

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list