https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32478
--- Comment #15 from Marcel de Rooy <[email protected]> --- We remove these lines completely now and just trust ->yaml_preference: - foreach my $line (@lines){ - my ($field,$array) = split /:/, $line; - next if !$array; - $field =~ s/^\s*|\s*$//g; - $array =~ s/[ [\]\r]//g; - my @array = split /,/, $array; - @array = map { $_ eq '""' || $_ eq "''" ? '' : $_ } @array; - @array = map { $_ eq 'NULL' ? undef : $_ } @array; - $pref_as_hash->{$field} = \@array; - } But this is not the same. If I pasted correct YAML previously like below, it would not work. ccode : - null - NULL - undefined - 2 - '3' Now it does. But perhaps more serious is the opposite, if I am entering some valid YAML array by 'forgetting' the first line: - null - NULL - undefined - 2 - '3' I will get back an array, while the former routine returned an empty hash ! This will trigger an error like: Not a HASH reference at /usr/share/koha/Koha/Item.pm line 2071. => foreach my $field (keys %$denyingrules) { This is a bit long way of saying: I still think that we may need an intermediate routine between pure YAML (yaml_preference) and what we expect for specific preferences? -- 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/
