Bug 17825

Summary: Remove C4::Members::AttributeTypes::AttributeTypeExists
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, kyle
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18348
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17755    
Bug Blocks: 15449    
Attachments: Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl
Bug 17825: (followup) Remove unused function AttributeTypeExists
[SIGNED-OFF] Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl
[SIGNED-OFF] Bug 17825: (followup) Remove unused function AttributeTypeExists
Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl
Bug 17825: (followup) Remove unused function AttributeTypeExists

Description Tomás Cohen Arazi 2016-12-29 14:30:46 UTC
With the introducion of Koha::Object-based Koha::Patron::Attribute::Type(s) there's no need for this function.
Comment 1 Tomás Cohen Arazi 2016-12-29 14:42:15 UTC
Created attachment 58491 [details] [review]
Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl

With the introducion of Koha::Object-based
Koha::Patron::Attribute::Type(s) there's no need for using this
function.

This patch replaces it with a regular ->search + ->count call.

To test:
- Have a user with checkouts logged into the OPAC on the opac-user.pl
page
- Set the SHOW_BCODE attribute to 'no' on the staff interface for the
user.
- Reload opac-user.pl
=> SUCCESS: The barcode is not shown for checked out items.
- Set the SHOW_BCODE atttribute to 'yes' on the staff interface for the
user.
- Reload opac-user.pl
=> SUCCESS: The barcode is shown for checked out items.
- Delete the Patron attribute type SHOW_BCODE
- Reload opac-user.pl
=> SUCCESS: No barcode is shown for checked out items
- Sign off :-D
Comment 2 Tomás Cohen Arazi 2016-12-29 14:42:30 UTC
Created attachment 58492 [details] [review]
Bug 17825: (followup) Remove unused function AttributeTypeExists
Comment 3 Owen Leonard 2017-01-04 17:20:15 UTC
Created attachment 58598 [details] [review]
[SIGNED-OFF] Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl

With the introducion of Koha::Object-based
Koha::Patron::Attribute::Type(s) there's no need for using this
function.

This patch replaces it with a regular ->search + ->count call.

To test:
- Have a user with checkouts logged into the OPAC on the opac-user.pl
page
- Set the SHOW_BCODE attribute to 'no' on the staff interface for the
user.
- Reload opac-user.pl
=> SUCCESS: The barcode is not shown for checked out items.
- Set the SHOW_BCODE atttribute to 'yes' on the staff interface for the
user.
- Reload opac-user.pl
=> SUCCESS: The barcode is shown for checked out items.
- Delete the Patron attribute type SHOW_BCODE
- Reload opac-user.pl
=> SUCCESS: No barcode is shown for checked out items
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Owen Leonard 2017-01-04 17:20:21 UTC
Created attachment 58599 [details] [review]
[SIGNED-OFF] Bug 17825: (followup) Remove unused function AttributeTypeExists

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Jonathan Druart 2017-03-15 12:05:33 UTC
Waiting for bug 13757 to QA it.
Comment 6 Jonathan Druart 2017-03-29 20:27:57 UTC
Created attachment 61713 [details] [review]
Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl

With the introducion of Koha::Object-based
Koha::Patron::Attribute::Type(s) there's no need for using this
function.

This patch replaces it with a regular ->search + ->count call.

To test:
- Have a user with checkouts logged into the OPAC on the opac-user.pl
page
- Set the SHOW_BCODE attribute to 'no' on the staff interface for the
user.
- Reload opac-user.pl
=> SUCCESS: The barcode is not shown for checked out items.
- Set the SHOW_BCODE atttribute to 'yes' on the staff interface for the
user.
- Reload opac-user.pl
=> SUCCESS: The barcode is shown for checked out items.
- Delete the Patron attribute type SHOW_BCODE
- Reload opac-user.pl
=> SUCCESS: No barcode is shown for checked out items
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2017-03-29 20:28:02 UTC
Created attachment 61714 [details] [review]
Bug 17825: (followup) Remove unused function AttributeTypeExists

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2017-03-29 20:29:33 UTC
Whaou, never heard about this SHOW_BCODE feature. It is badly coded, should be  borrowers DB column, right?
Comment 9 Tomás Cohen Arazi 2017-03-29 20:38:57 UTC
(In reply to Jonathan Druart from comment #8)
> Whaou, never heard about this SHOW_BCODE feature. It is badly coded, should
> be  borrowers DB column, right?

Definitely!
Comment 10 Kyle M Hall 2017-03-31 15:18:11 UTC
Pushed to master for 17.05, thanks Tomas!
Comment 11 Katrin Fischer 2017-04-02 17:51:43 UTC
Dependency is not in 16.11.x so this should not be needed there.