Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Summary: Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
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: Martin Renvoize
URL:
Keywords:
Depends on: 17251
Blocks: 15799 17253
  Show dependency treegraph
 
Reported: 2016-09-05 14:18 UTC by Jonathan Druart
Modified: 2023-01-30 17:13 UTC (History)
2 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 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.30 KB, patch)
2016-09-05 16:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.29 KB, patch)
2016-09-13 08:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.31 KB, patch)
2016-10-12 10:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.31 KB, patch)
2016-10-12 13:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.37 KB, patch)
2016-10-12 15:12 UTC, Claire Gravely
Details | Diff | Splinter Review
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.45 KB, patch)
2016-10-13 13:27 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping (9.91 KB, patch)
2016-10-13 13:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode (15.51 KB, patch)
2016-10-13 13:41 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:18:48 UTC

    
Comment 1 Jonathan Druart 2016-09-05 16:05:10 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-09-13 08:58:57 UTC
Created attachment 55519 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED
Comment 3 Jonathan Druart 2016-10-12 10:29:21 UTC
Created attachment 56245 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED
Comment 4 Jonathan Druart 2016-10-12 10:29:45 UTC
Rebased patches.
Comment 5 Jonathan Druart 2016-10-12 13:53:22 UTC
Created attachment 56282 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED
Comment 6 Claire Gravely 2016-10-12 15:12:19 UTC
Created attachment 56296 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 7 Martin Renvoize 2016-10-13 13:27:41 UTC
Created attachment 56398 [details] [review]
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

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:28:10 UTC
Loving to cleaner code this tree is moving to :)
Comment 9 Martin Renvoize 2016-10-13 13:41:23 UTC
Created attachment 56402 [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>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2016-10-13 13:41:39 UTC
Created attachment 56403 [details] [review]
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2016-10-13 13:42:58 UTC
ack.. wrong bug.. already qa'd this one five minutes ago. ignore last two comments and the double commit line.. will clean that back out now.
Comment 12 Kyle M Hall 2016-10-21 16:15:08 UTC
Pushed to master for 16.11, thanks Jonathan!