Bug 41268

Summary: Circulation rules script has many conditionals
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens (kidclamp) <nick>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, kyle, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41268: use variables rather than conditionals

Description Nick Clemens (kidclamp) 2025-11-18 21:54:14 UTC
Focusing on delete-branch-item-rule operation we have four code paths:
1 - if the branch is '*' and itemtype is '*'
2 - if branch is '*' and itemtype is specific
3 - If branch is specific and itemtype is '*'
4 - if branch is specific and itemtype is specified

The only difference in these being that we pass 'undef' instead of '*' when star is set.

I don't undertstand why we can't set a variable to 'undef' if necessary?
Comment 1 Nick Clemens (kidclamp) 2025-11-18 21:55:10 UTC
Created attachment 189689 [details] [review]
Bug 41268: use variables rather than conditionals