Bug 17251 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
Summary: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 17226 17250
Blocks: 15799 17252
  Show dependency treegraph
 
Reported: 2016-09-05 14:17 UTC by Jonathan Druart
Modified: 2017-06-14 22:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping (9.67 KB, patch)
2016-09-05 15:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping (9.65 KB, patch)
2016-10-12 10:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping (9.71 KB, patch)
2016-10-12 11:55 UTC, Claire Gravely
Details | Diff | Splinter Review
[PASSED QA] Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping (9.79 KB, patch)
2016-10-13 13:14 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-09-05 14:17:45 UTC

    
Comment 1 Jonathan Druart 2016-09-05 15:47:15 UTC
Created attachment 55187 [details] [review]
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping

This subroutine was only used once in GetItemsForInventory.
It can be replaced with a quite simple search on AV join on
authorised_value_categories and marc_subfield_structures tables.

Note that the "interface" parameter was always set to "staff" and was
useless.

Test plan:
Play with the inventory and confirm that the AV descriptions are
correctly displayed.

The tests in t/db_dependent/Items/GetItemsForInventory.t cover this
change and should still pass.
Comment 2 Claire Gravely 2016-10-10 14:08:49 UTC
fatal: sha1 information is lacking or useless (C4/Items.pm).
Comment 3 Jonathan Druart 2016-10-12 10:27:33 UTC
Created attachment 56244 [details] [review]
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping

This subroutine was only used once in GetItemsForInventory.
It can be replaced with a quite simple search on AV join on
authorised_value_categories and marc_subfield_structures tables.

Note that the "interface" parameter was always set to "staff" and was
useless.

Test plan:
Play with the inventory and confirm that the AV descriptions are
correctly displayed.

The tests in t/db_dependent/Items/GetItemsForInventory.t cover this
change and should still pass.
Comment 4 Claire Gravely 2016-10-12 10:36:09 UTC
When trying to access /cgi-bin/koha/admin/authorised_values.pl from the administration page i get this error:

DBIx::Class::Storage::DBI::_dbh_execute(): Table 'koha_kohadev.authorised_value_categories' doesn't exist at /home/vagrant/kohaclone/Koha/Objects.pm line 120


I also got this when trying to prove the test:

t/db_dependent/Items/GetItemsForInventory.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 6 tests but ran 0.
Comment 5 Claire Gravely 2016-10-12 11:55:13 UTC
Created attachment 56258 [details] [review]
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping

This subroutine was only used once in GetItemsForInventory.
It can be replaced with a quite simple search on AV join on
authorised_value_categories and marc_subfield_structures tables.

Note that the "interface" parameter was always set to "staff" and was
useless.

Test plan:
Play with the inventory and confirm that the AV descriptions are
correctly displayed.

The tests in t/db_dependent/Items/GetItemsForInventory.t cover this
change and should still pass.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 6 Jonathan Druart 2016-10-12 11:59:14 UTC
(In reply to Claire Gravely from comment #4)
> When trying to access /cgi-bin/koha/admin/authorised_values.pl from the
> administration page i get this error:
> 
> DBIx::Class::Storage::DBI::_dbh_execute(): Table
> 'koha_kohadev.authorised_value_categories' doesn't exist at
> /home/vagrant/kohaclone/Koha/Objects.pm line 120
> 
> 
> I also got this when trying to prove the test:
> 
> t/db_dependent/Items/GetItemsForInventory.t (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: Bad plan.  You planned 6 tests but ran 0.

For the record: The DBIx::Class schema files were not up-to-date.
Comment 7 Martin Renvoize 2016-10-13 13:14:20 UTC
Created attachment 56392 [details] [review]
[PASSED QA] Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping

This subroutine was only used once in GetItemsForInventory.
It can be replaced with a quite simple search on AV join on
authorised_value_categories and marc_subfield_structures tables.

Note that the "interface" parameter was always set to "staff" and was
useless.

Test plan:
Play with the inventory and confirm that the AV descriptions are
correctly displayed.

The tests in t/db_dependent/Items/GetItemsForInventory.t cover this
change and should still pass.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2016-10-13 13:14:46 UTC
Thanks Jonathan
Comment 9 Kyle M Hall 2016-10-21 15:34:42 UTC
Pushed to master for 16.11, thanks Jonathan!