[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
Tue Jan 23 17:42:10 CET 2024


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

Matt Blenkinsop <matt.blenkinsop at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #161249|0                           |1
        is obsolete|                            |

--- Comment #2 from Matt Blenkinsop <matt.blenkinsop at ptfs-europe.com> ---
Created attachment 161307
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161307&action=edit
Bug 35836: Search for loops in dependencies.

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

Signed-off-by: Matt Blenkinsop <matt.blenkinsop at ptfs-europe.com>

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


More information about the Koha-bugs mailing list