[Koha-bugs] [Bug 10577] C4::Budgets::GetBudgetPeriod has inappropriate overloading of its behavior

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 13 12:17:45 CET 2019


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

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

--- Comment #5 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 86563
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86563&action=edit
bug 10577: improve semantics of GetBudgetPeriod()

Remove the option to pass zero to this function in
order to get "the" active budget.  This was a problem
in three ways:

- Koha doesn't require that there be only one active
  budget at a time, so the concept of "the" active
  budget doesn't make sense.
- Having the single parameter be either an ID or a flag
  based on its value is poor function design.
- No callers of GetBudgetPeriod() were actually using this
  modality.

This patch also improves the DB-dependent tests for budgets by

- wrapping the test in a transaction
- counting budgets correctly

To test:

[1] Apply the patch.
[2] Verify that prove -v t/db_dependent/Budgets.t passes
[3] Verify in the staff interface that:
    - the budget hierarchy displays correctly
    - you can add and modify a budget

Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: Martin Renvoize <martin.renvoize 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