Bug 41268 - Circulation rules script has many conditionals
Summary: Circulation rules script has many conditionals
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-18 21:54 UTC by Nick Clemens (kidclamp)
Modified: 2025-11-18 21:56 UTC (History)
4 users (show)

See Also:
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 (3.53 KB, patch)
2025-11-18 21:55 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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