Bug 17251

Summary: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: claire_gravely, kyle, martin.renvoize
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17226, 17250    
Bug Blocks: 15799, 17252    
Attachments: Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
[PASSED QA] Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping

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!