https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20930

Jonathan Druart <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA
                 CC|                            |[email protected]
                   |                            |ommunity.org

--- Comment #29 from Jonathan Druart <[email protected]> 
---
QA comments:
1. You remove the validation from GetHiddenItemnumbers and so assume that the
data in the pref is correct, but maybe wrong data exist in the DB prior to this
patch.
(Also, use YAML in C4::Items that is no longer needed)

2. I do not think we should not use YAML to convert the syspref's value to perl
struct.
For instance, "field: [value1, value2]" does not work, ie. the
ref($syspref_val) return an empty string (means it's a scalar):
To recreate, edit OpacHiddenItems with "field: [value1, value2]"
Apply:
diff --git a/C4/Items.pm b/C4/Items.pm
index 519ce41991..283def5e4c 100644
--- a/C4/Items.pm
+++ b/C4/Items.pm
@@ -1202,6 +1202,8 @@ sub GetHiddenItemnumbers {
     my @resultitems;

     my $hidingrules = C4::Context->preference('OpacHiddenItems');
+    warn $hidingrules;
+    warn ref($hidingrules);
     return () if !$hidingrules or ref($hidingrules) ne 'HASH';
     my $dbh = C4::Context->dbh;

Finally run:
use Koha::Items;                                                                
use C4::Items;                                                                  
my $items = Koha::Items->search->unblessed;                                     
C4::Items::GetHiddenItemnumbers({items => $items}); 

It displays:
field: [value1, value2] at /kohadevbox/koha/C4/Items.pm line 1205.
Warning: something's wrong at /kohadevbox/koha/C4/Items.pm line 1206.

3. "Error: your data might not have been saved", it is what I get when I
generate an invalid yaml, I do not get info about the line, or what the error
is.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to