Bug 15800: Koha::AuthorisedValues - Remove C4::Koha::IsAuthorisedValueCategory
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 10 Feb 2016 15:37:30 +0000 (15:37 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 2 Mar 2016 03:54:16 +0000 (03:54 +0000)
commit0fdc1021d4477d838c6b38a1172137a5eec08978
treeac392d5d81f20353016a7fb01166ce8741db7476
parent10a9a1e147699bdb1fd2b58ab93fe87cb82074cf
Bug 15800: Koha::AuthorisedValues - Remove C4::Koha::IsAuthorisedValueCategory

C4::Koha::IsAuthorisedValueCategory contains only 2 useful calls, from
C4::Reports::Guided and reports/guided_reports.pl
It can be replaced with
  Koha::AuthorisedValues->search({ category => $authorised_value})->count

Test plan:
1/ Create a sql report using an authorised value category, something
like:
  SELECT COUNT(*) FROM items where itemlost=<<lost|LOST>>
2/ Execute the report and confirm that everything works fine.
3/ Create a sql report using a nonexistent authorised value categor,
something like:
  SELECT COUNT(*) FROM items where itemlost=<<lost|NONEXIST>>
4/ When saving the report, you should get a warning message
  "lost: The authorized value category (NONEXIST) you selected does not exist."
5/ Save anyway and execute the report, you should get the same warning
message.

QA:
  git grep IsAuthorisedValueCategory
should not return any results
  prove t/db_dependent/ReportsGuided.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
C4/Koha.pm
C4/Reports/Guided.pm
reports/guided_reports.pl
t/Koha.t
t/db_dependent/ReportsGuided.t