[Koha-bugs] [Bug 10577] New: C4::Budgets::GetBudgetPeriod has inappropriate overloading of its behavior
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Jul 11 18:25:08 CEST 2013
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10577
Bug ID: 10577
Summary: C4::Budgets::GetBudgetPeriod has inappropriate
overloading of its behavior
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P5 - low
Component: Acquisitions
Assignee: koha-bugs at lists.koha-community.org
Reporter: gmcharlt at gmail.com
GetBudgetPeriod, when passed a fund ID (budget_period_id), returns a hashref of
an individual budget, consistent with other functions of its sort.
However, it also has a special mode -- if you pass 0 as its parameter, it
returns a hashref of the first active budget. This is a problem for several
reasons:
[1] Nothing in Koha requires that there be only one active budget.
Consequently, a function that returns "the" active one is working from an
incorrect assumption (albeit, maybe one that used to be true when acquisitions
support was originally added?).
[2] Even the assumption were true that there can be only one active budget at a
time, it is still bad practice for the one parameter of a function to either be
an ID or a flag.
[3] There is no code, other than a test case, that actually calls
GetBudgetPeriod(0).
--
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