Bug 17825 - Remove C4::Members::AttributeTypes::AttributeTypeExists
Summary: Remove C4::Members::AttributeTypes::AttributeTypeExists
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
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 17755
Blocks: 15449
  Show dependency treegraph
 
Reported: 2016-12-29 14:30 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2017-12-07 22:15 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:
Circulation function:


Attachments
Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl (1.94 KB, patch)
2016-12-29 14:42 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 17825: (followup) Remove unused function AttributeTypeExists (2.08 KB, patch)
2016-12-29 14:42 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl (1.99 KB, patch)
2017-01-04 17:20 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17825: (followup) Remove unused function AttributeTypeExists (2.13 KB, patch)
2017-01-04 17:20 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl (2.05 KB, patch)
2017-03-29 20:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17825: (followup) Remove unused function AttributeTypeExists (2.19 KB, patch)
2017-03-29 20:28 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 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 (tcohen) 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 (tcohen) 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 (tcohen) 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 (khall) 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.