Bug 10872 - C4::Items GetHiddenItems fix and optimization
authorMark Tompsett <mtompset@hotmail.com>
Tue, 10 Sep 2013 20:19:58 +0000 (16:19 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 11 Nov 2013 13:29:23 +0000 (10:29 -0300)
commit29dca939e0bd3a090d908a2bde30c942bac86342
treea0f2ddb0e0d91348b03cb013f03147441c3f9a2f
parenta461452de234fcdd3d08974c9f0b9b03772710f3
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.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9ab593440b6d2b1f9c417631a4cf5cabcf1a0032)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Items.pm