Summary: | C4::Items GetHiddenItems fix and optimization | ||
---|---|---|---|
Product: | Koha | Reporter: | Mark Tompsett <mtompset> |
Component: | Architecture, internals, and plumbing | Assignee: | Mark Tompsett <mtompset> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | gmcharlt, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10876 http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10584 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 10584 | ||
Attachments: |
Bug 10872 - C4::Items.pm has YAML::Load in GetHiddenItems but lacks use or require
Bug 10872 - C4::Items GetHiddenItems fix and optimization Bug 10872 - C4::Items GetHiddenItems fix and optimization Bug 10872 - C4::Items GetHiddenItems fix and optimization Bug 10872: UT for GetHiddenItemnumbers and POD fix |
Description
Mark Tompsett
2013-09-10 20:13:21 UTC
Created attachment 20973 [details] [review] Bug 10872 - C4::Items.pm has YAML::Load in GetHiddenItems but lacks use or require There should be a: "require YAML;" or "use YAML qw/Load/;" as the GetHiddenItems routine has a reference to YAML::Load. This was discovered while adding a GetHiddenItems() call into opac/opac-MARCdetail.pl. I believe this problem dates back to bug 6488 or bug 5984. It's not really an enhancement, as it should have been optimized in the first place. Changed to a "minor" bug as a result, since part of this wasn't even visible without another bug fix which is yet to come. Created attachment 20977 [details] [review] Bug 10872 - C4::Items GetHiddenItems fix and optimization There should be a: "require YAML;" or "use YAML qw/Load/;" as the GetHiddenItems routine has a reference to YAML::Load. This was discovered while adding a GetHiddenItems() call into opac/opac-MARCdetail.pl. I believe this problem dates back to bug 6488 or bug 5984. I also added an optimization to GetHiddenItems to prevent processing if there is nothing in the system preference. Test by searching for a biblio which has some or all of its items hidden. Created attachment 21069 [details] [review] Bug 10872 - C4::Items GetHiddenItems fix and optimization There should be a: "require YAML;" or "use YAML qw/Load/;" as the GetHiddenItems routine has a reference to YAML::Load. This was discovered while adding a GetHiddenItems() call into opac/opac-MARCdetail.pl. I believe this problem dates back to bug 6488 or bug 5984. I also added an optimization to GetHiddenItems to prevent processing if there is nothing in the system preference. Test by searching for a biblio which has some or all of its items hidden. Signed-off-by: Mason James <mtj@kohaaloha.com> Created attachment 21075 [details] [review] Bug 10872 - C4::Items GetHiddenItems fix and optimization There should be a: "require YAML;" or "use YAML qw/Load/;" as the GetHiddenItems routine has a reference to YAML::Load. This was discovered while adding a GetHiddenItems() call into opac/opac-MARCdetail.pl. I believe this problem dates back to bug 6488 or bug 5984. I also added an optimization to GetHiddenItems to prevent processing if there is nothing in the system preference. Test by searching for a biblio which has some or all of its items hidden. Signed-off-by: Mason James <mtj@kohaaloha.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Maybe return () unless $yaml =~ /\S/; or return () if $yaml =~ /^\s*$/; would have been easier to read. Created attachment 21125 [details] [review] Bug 10872: UT for GetHiddenItemnumbers and POD fix This patch adds several unit tests for GetHiddenItemnumbers and fixes the POD for it. It also wraps the tests for rollback, modernizes and adds a license text to it. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Reviewed and passed QA on this, as it is part of a patch series that I want to push as a unit. Pushed to master. Thanks, Mark! This patch has been pushed to 3.12.x, will be in 3.12.7. Thanks Mark! |