Bug 31740

Summary: Illrequests table has a foreign key constraint on status_alias
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: martin.renvoize, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31716
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2022-10-12 11:32:14 UTC
I am not sure the intent of this foreign key, however it seems problematic as we can't tie it to a single category

To test:
1 - Add an authorised value for Asort1:
    Authorised value: MONKEY
    Description: Capuchin
2 - Add an authroised value for LOC:
    Authorised value: MONKEY
    Description: Spider
3 - Put an illrequest in the DB:
    INSERT INTO illrequests (branchcode,status,status_alias) VALUES ('CPL','REQUEST_TEST','MONKEY')
4 - Delete one of the authorised values above
5 - Check the DB:
    SELECT status_alias FROM illrequests WHERE status = 'REQUEST_TEST'
6 - Note the status is nulled by deletion of unrelated authroised value