I believe the description covers it all. There is no testing, except does anything using C4::Items still work? 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 GetHiddenItems() calls into opac/opac-MARCdetail.pl. I believe this problem dates back to bug 6488 or bug 5984.
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!