View | Details | Raw Unified | Return to bug 27673
Collapse All | Expand All

(-)a/C4/Auth_with_cas.pm (-2 / +2 lines)
Lines 26-32 use Koha::AuthUtils qw(get_script_name); Link Here
26
use Authen::CAS::Client;
26
use Authen::CAS::Client;
27
use CGI qw ( -utf8 );
27
use CGI qw ( -utf8 );
28
use FindBin;
28
use FindBin;
29
use YAML;
29
use YAML::XS;
30
30
31
31
32
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug);
32
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug);
Lines 44-50 my $yamlauthfile = C4::Context->config('intranetdir') . "/C4/Auth_cas_servers.ya Link Here
44
44
45
# If there's a configuration for multiple cas servers, then we get it
45
# If there's a configuration for multiple cas servers, then we get it
46
if (multipleAuth()) {
46
if (multipleAuth()) {
47
    ($defaultcasserver, $casservers) = YAML::LoadFile($yamlauthfile);
47
    ($defaultcasserver, $casservers) = YAML::XS::LoadFile($yamlauthfile);
48
    $defaultcasserver = $defaultcasserver->{'default'};
48
    $defaultcasserver = $defaultcasserver->{'default'};
49
} else {
49
} else {
50
# Else, we fall back to casServerUrl syspref
50
# Else, we fall back to casServerUrl syspref
(-)a/C4/Circulation.pm (-1 / +3 lines)
Lines 21-26 package C4::Circulation; Link Here
21
use Modern::Perl;
21
use Modern::Perl;
22
use DateTime;
22
use DateTime;
23
use POSIX qw( floor );
23
use POSIX qw( floor );
24
use YAML::XS;
25
24
use Koha::DateUtils;
26
use Koha::DateUtils;
25
use C4::Context;
27
use C4::Context;
26
use C4::Stats;
28
use C4::Stats;
Lines 2014-2020 sub AddReturn { Link Here
2014
    if ($yaml) {
2016
    if ($yaml) {
2015
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
2017
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
2016
        my $rules;
2018
        my $rules;
2017
        eval { $rules = YAML::Load($yaml); };
2019
        eval { $rules = YAML::XS::Load($yaml); };
2018
        if ($@) {
2020
        if ($@) {
2019
            warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref : $@";
2021
            warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref : $@";
2020
        }
2022
        }
(-)a/C4/Context.pm (-2 / +2 lines)
Lines 96-102 use Encode; Link Here
96
use File::Spec;
96
use File::Spec;
97
use Module::Load::Conditional qw(can_load);
97
use Module::Load::Conditional qw(can_load);
98
use POSIX ();
98
use POSIX ();
99
use YAML qw/Load/;
99
use YAML::XS;
100
use ZOOM;
100
use ZOOM;
101
101
102
use C4::Boolean;
102
use C4::Boolean;
Lines 445-451 the value cannot be properly decoded as YAML. Link Here
445
sub yaml_preference {
445
sub yaml_preference {
446
    my ( $self, $preference ) = @_;
446
    my ( $self, $preference ) = @_;
447
447
448
    my $yaml = eval { YAML::Load( $self->preference( $preference ) ); };
448
    my $yaml = eval { YAML::XS::Load( $self->preference( $preference ) ); };
449
    if ($@) {
449
    if ($@) {
450
        warn "Unable to parse $preference syspref : $@";
450
        warn "Unable to parse $preference syspref : $@";
451
        return;
451
        return;
(-)a/C4/Items.pm (-2 / +2 lines)
Lines 57-63 use MARC::Record; Link Here
57
use C4::ClassSource;
57
use C4::ClassSource;
58
use C4::Log;
58
use C4::Log;
59
use List::MoreUtils qw(any);
59
use List::MoreUtils qw(any);
60
use YAML qw(Load);
60
use YAML::XS;
61
use DateTime::Format::MySQL;
61
use DateTime::Format::MySQL;
62
use Data::Dumper; # used as part of logging item record changes, not just for
62
use Data::Dumper; # used as part of logging item record changes, not just for
63
                  # debugging; so please don't remove this
63
                  # debugging; so please don't remove this
Lines 982-988 sub GetHiddenItemnumbers { Link Here
982
    $yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt
982
    $yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt
983
    my $hidingrules;
983
    my $hidingrules;
984
    eval {
984
    eval {
985
        $hidingrules = YAML::Load($yaml);
985
        $hidingrules = YAML::XS::Load($yaml);
986
    };
986
    };
987
    if ($@) {
987
    if ($@) {
988
        warn "Unable to parse OpacHiddenItems syspref : $@";
988
        warn "Unable to parse OpacHiddenItems syspref : $@";
(-)a/C4/Record.pm (-3 / +3 lines)
Lines 29-35 use Unicode::Normalize; # _entity_encode Link Here
29
use C4::Biblio; #marc2bibtex
29
use C4::Biblio; #marc2bibtex
30
use C4::Koha; #marc2csv
30
use C4::Koha; #marc2csv
31
use C4::XSLT ();
31
use C4::XSLT ();
32
use YAML; #marcrecords2csv
32
use YAML::XS; #marcrecords2csv
33
use Template;
33
use Template;
34
use Text::CSV::Encoded; #marc2csv
34
use Text::CSV::Encoded; #marc2csv
35
use Koha::Items;
35
use Koha::Items;
Lines 415-421 sub marc2csv { Link Here
415
    my $configfile = "../tools/csv-profiles/$id.yaml";
415
    my $configfile = "../tools/csv-profiles/$id.yaml";
416
    my ($preprocess, $postprocess, $fieldprocessing);
416
    my ($preprocess, $postprocess, $fieldprocessing);
417
    if (-e $configfile){
417
    if (-e $configfile){
418
        ($preprocess,$postprocess, $fieldprocessing) = YAML::LoadFile($configfile);
418
        ($preprocess,$postprocess, $fieldprocessing) = YAML::XS::LoadFile($configfile);
419
    }
419
    }
420
420
421
    # Preprocessing
421
    # Preprocessing
Lines 800-806 sub marc2bibtex { Link Here
800
    my $additional_fields;
800
    my $additional_fields;
801
    if ($BibtexExportAdditionalFields) {
801
    if ($BibtexExportAdditionalFields) {
802
        $BibtexExportAdditionalFields = "$BibtexExportAdditionalFields\n\n";
802
        $BibtexExportAdditionalFields = "$BibtexExportAdditionalFields\n\n";
803
        $additional_fields = eval { YAML::Load($BibtexExportAdditionalFields); };
803
        $additional_fields = eval { YAML::XS::Load($BibtexExportAdditionalFields); };
804
        if ($@) {
804
        if ($@) {
805
            warn "Unable to parse BibtexExportAdditionalFields : $@";
805
            warn "Unable to parse BibtexExportAdditionalFields : $@";
806
            $additional_fields = undef;
806
            $additional_fields = undef;
(-)a/C4/Ris.pm (-1 / +2 lines)
Lines 63-68 package C4::Ris; Link Here
63
use Modern::Perl;
63
use Modern::Perl;
64
64
65
use List::MoreUtils qw/uniq/;
65
use List::MoreUtils qw/uniq/;
66
use YAML::XS;
66
use vars qw(@ISA @EXPORT);
67
use vars qw(@ISA @EXPORT);
67
68
68
use Koha::SimpleMARC qw(read_field);
69
use Koha::SimpleMARC qw(read_field);
Lines 119-125 sub marc2ris { Link Here
119
    my $ris_additional_fields;
120
    my $ris_additional_fields;
120
    if ($RisExportAdditionalFields) {
121
    if ($RisExportAdditionalFields) {
121
        $RisExportAdditionalFields = "$RisExportAdditionalFields\n\n";
122
        $RisExportAdditionalFields = "$RisExportAdditionalFields\n\n";
122
        $ris_additional_fields = eval { YAML::Load($RisExportAdditionalFields); };
123
        $ris_additional_fields = eval { YAML::XS::Load($RisExportAdditionalFields); };
123
        if ($@) {
124
        if ($@) {
124
            warn "Unable to parse RisExportAdditionalFields : $@";
125
            warn "Unable to parse RisExportAdditionalFields : $@";
125
            $ris_additional_fields = undef;
126
            $ris_additional_fields = undef;
(-)a/C4/SMS.pm (-2 / +2 lines)
Lines 102-109 sub send_sms { Link Here
102
102
103
    my %args;
103
    my %args;
104
    if ( -f $conf_file ) {
104
    if ( -f $conf_file ) {
105
        require YAML;
105
        require YAML::XS;
106
        my $conf = YAML::LoadFile( $conf_file );
106
        my $conf = YAML::XS::LoadFile( $conf_file );
107
        %args = map { q{_} . $_ => $conf->{$_} } keys %$conf;
107
        %args = map { q{_} . $_ => $conf->{$_} } keys %$conf;
108
    }
108
    }
109
109
(-)a/C4/Search.pm (-1 lines)
Lines 33-39 use Koha::ItemTypes; Link Here
33
use Koha::Libraries;
33
use Koha::Libraries;
34
use Koha::Patrons;
34
use Koha::Patrons;
35
use Koha::RecordProcessor;
35
use Koha::RecordProcessor;
36
use YAML;
37
use URI::Escape;
36
use URI::Escape;
38
use Business::ISBN;
37
use Business::ISBN;
39
use MARC::Record;
38
use MARC::Record;
(-)a/C4/Utils/DataTables/TablesSettings.pm (-2 / +2 lines)
Lines 2-8 package C4::Utils::DataTables::TablesSettings; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use List::Util qw( first );
4
use List::Util qw( first );
5
use YAML;
5
use YAML::XS;
6
use C4::Context;
6
use C4::Context;
7
use Koha::Database;
7
use Koha::Database;
8
use Koha::Caches;
8
use Koha::Caches;
Lines 13-19 sub get_yaml { Link Here
13
    my $yaml  = $cache->get_from_cache('TablesSettingsYaml');
13
    my $yaml  = $cache->get_from_cache('TablesSettingsYaml');
14
14
15
    unless ($yaml) {
15
    unless ($yaml) {
16
        $yaml = eval { YAML::LoadFile($yml_path) };
16
        $yaml = eval { YAML::XS::LoadFile($yml_path) };
17
        warn "ERROR: the yaml file for DT::TablesSettings is not correctly formatted: $@"
17
        warn "ERROR: the yaml file for DT::TablesSettings is not correctly formatted: $@"
18
          if $@;
18
          if $@;
19
        $cache->set_in_cache( 'TablesSettingsYaml', $yaml, { expiry => 3600 } );
19
        $cache->set_in_cache( 'TablesSettingsYaml', $yaml, { expiry => 3600 } );
(-)a/Koha/Filter/MARC/EmbedItems.pm (-1 / +1 lines)
Lines 31-37 my $biblio = Koha::Biblios->find( Link Here
31
my $opachiddenitems_rules;
31
my $opachiddenitems_rules;
32
eval {
32
eval {
33
    my $yaml = C4::Context->preference('OpacHiddenItems') . "\n\n";
33
    my $yaml = C4::Context->preference('OpacHiddenItems') . "\n\n";
34
    $opachiddenitems_rules = YAML::Load($yaml);
34
    $opachiddenitems_rules = YAML::XS::Load($yaml);
35
};
35
};
36
36
37
my @items  = grep { !$_->hidden_in_opac({ rules => $opachiddenitems_rules }) @{$biblio->items};
37
my @items  = grep { !$_->hidden_in_opac({ rules => $opachiddenitems_rules }) @{$biblio->items};
(-)a/Koha/Template/Plugin/TablesSettings.pm (-1 lines)
Lines 54-60 use Modern::Perl; Link Here
54
use Template::Plugin;
54
use Template::Plugin;
55
use base qw( Template::Plugin );
55
use base qw( Template::Plugin );
56
56
57
use YAML qw( LoadFile );
58
use JSON qw( to_json );
57
use JSON qw( to_json );
59
58
60
use C4::Context qw( config );
59
use C4::Context qw( config );
(-)a/Koha/Z3950Responder/GenericSession.pm (-2 / +2 lines)
Lines 49-56 sub start_search { Link Here
49
    my ( $self, $args, $num_to_prefetch ) = @_;
49
    my ( $self, $args, $num_to_prefetch ) = @_;
50
50
51
    if (!defined $self->{'attribute_mappings'}) {
51
    if (!defined $self->{'attribute_mappings'}) {
52
        require YAML;
52
        require YAML::XS;
53
        $self->{'attribute_mappings'} = YAML::LoadFile($self->{server}->{config_dir} . 'attribute_mappings.yaml');
53
        $self->{'attribute_mappings'} = YAML::XS::LoadFile($self->{server}->{config_dir} . 'attribute_mappings.yaml');
54
    }
54
    }
55
55
56
    my $database = $args->{DATABASES}->[0];
56
    my $database = $args->{DATABASES}->[0];
(-)a/about.pl (-4 / +4 lines)
Lines 33-39 use XML::Simple; Link Here
33
use Config;
33
use Config;
34
use Search::Elasticsearch;
34
use Search::Elasticsearch;
35
use Try::Tiny;
35
use Try::Tiny;
36
use YAML qw/LoadFile/;
36
use YAML::XS;
37
37
38
use C4::Output;
38
use C4::Output;
39
use C4::Auth;
39
use C4::Auth;
Lines 429-435 my @bad_yaml_prefs; Link Here
429
foreach my $syspref (@yaml_prefs) {
429
foreach my $syspref (@yaml_prefs) {
430
    my $yaml = C4::Context->preference( $syspref );
430
    my $yaml = C4::Context->preference( $syspref );
431
    if ( $yaml ) {
431
    if ( $yaml ) {
432
        eval { YAML::Load( "$yaml\n\n" ); };
432
        eval { YAML::XS::Load( "$yaml\n\n" ); };
433
        if ($@) {
433
        if ($@) {
434
            push @bad_yaml_prefs, $syspref;
434
            push @bad_yaml_prefs, $syspref;
435
        }
435
        }
Lines 666-672 if ( defined C4::Context->config('docdir') ) { Link Here
666
## Release teams
666
## Release teams
667
my $teams =
667
my $teams =
668
  -e "$docdir" . "/teams.yaml"
668
  -e "$docdir" . "/teams.yaml"
669
  ? LoadFile( "$docdir" . "/teams.yaml" )
669
  ? YAML::XS::LoadFile( "$docdir" . "/teams.yaml" )
670
  : {};
670
  : {};
671
my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0];
671
my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0];
672
my $short_version = substr($versions{'kohaVersion'},0,5);
672
my $short_version = substr($versions{'kohaVersion'},0,5);
Lines 678-684 $template->param( development_version => $development_version ); Link Here
678
## Contributors
678
## Contributors
679
my $contributors =
679
my $contributors =
680
  -e "$docdir" . "/contributors.yaml"
680
  -e "$docdir" . "/contributors.yaml"
681
  ? LoadFile( "$docdir" . "/contributors.yaml" )
681
  ? YAML::XS::LoadFile( "$docdir" . "/contributors.yaml" )
682
  : {};
682
  : {};
683
for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
683
for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
684
    for my $role ( keys %{ $teams->{team}->{$version} } ) {
684
    for my $role ( keys %{ $teams->{team}->{$version} } ) {
(-)a/acqui/addorderiso2709.pl (-3 / +3 lines)
Lines 24-30 Link Here
24
use Modern::Perl;
24
use Modern::Perl;
25
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
26
use Carp;
26
use Carp;
27
use YAML qw/Load/;
27
use YAML::XS;
28
use List::MoreUtils qw/uniq/;
28
use List::MoreUtils qw/uniq/;
29
29
30
use C4::Context;
30
use C4::Context;
Lines 678-684 sub get_infos_syspref { Link Here
678
    my $syspref = C4::Context->preference($syspref_name);
678
    my $syspref = C4::Context->preference($syspref_name);
679
    $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt
679
    $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt
680
    my $yaml = eval {
680
    my $yaml = eval {
681
        YAML::Load($syspref);
681
        YAML::XS::Load($syspref);
682
    };
682
    };
683
    if ( $@ ) {
683
    if ( $@ ) {
684
        warn "Unable to parse $syspref syspref : $@";
684
        warn "Unable to parse $syspref syspref : $@";
Lines 724-730 sub get_infos_syspref_on_item { Link Here
724
    my $syspref = C4::Context->preference($syspref_name);
724
    my $syspref = C4::Context->preference($syspref_name);
725
    $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt
725
    $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt
726
    my $yaml = eval {
726
    my $yaml = eval {
727
        YAML::Load($syspref);
727
        YAML::XS::Load($syspref);
728
    };
728
    };
729
    if ( $@ ) {
729
    if ( $@ ) {
730
        warn "Unable to parse $syspref syspref : $@";
730
        warn "Unable to parse $syspref syspref : $@";
(-)a/admin/columns_settings.pl (-1 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use CGI;
4
use CGI;
5
use YAML qw( LoadFile );
6
use C4::Auth;
5
use C4::Auth;
7
use C4::Context;
6
use C4::Context;
8
use C4::Output;
7
use C4::Output;
(-)a/admin/systempreferences.pl (-1 / +1 lines)
Lines 50-56 use C4::Koha; Link Here
50
use C4::Languages qw(getTranslatedLanguages);
50
use C4::Languages qw(getTranslatedLanguages);
51
use C4::ClassSource;
51
use C4::ClassSource;
52
use C4::Output;
52
use C4::Output;
53
use YAML::Syck qw( Dump LoadFile );
53
use YAML::Syck qw( LoadFile );
54
54
55
my %tabsysprefs; #we do no longer need to keep track of a tab per pref (yaml)
55
my %tabsysprefs; #we do no longer need to keep track of a tab per pref (yaml)
56
56
(-)a/circ/pendingreserves.pl (-1 / +2 lines)
Lines 21-26 use Modern::Perl; Link Here
21
21
22
use constant PULL_INTERVAL => 2;
22
use constant PULL_INTERVAL => 2;
23
use List::MoreUtils qw( uniq );
23
use List::MoreUtils qw( uniq );
24
use YAML::XS;
24
25
25
use C4::Context;
26
use C4::Context;
26
use C4::Output;
27
use C4::Output;
Lines 109-115 if ( $op eq 'cancel_reserve' and $reserve_id ) { Link Here
109
        if ( my $yaml = C4::Context->preference('UpdateItemWhenLostFromHoldList') ) {
110
        if ( my $yaml = C4::Context->preference('UpdateItemWhenLostFromHoldList') ) {
110
            $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
111
            $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
111
            my $assignments;
112
            my $assignments;
112
            eval { $assignments = YAML::Load($yaml); };
113
            eval { $assignments = YAML::XS::Load($yaml); };
113
            if ($@) {
114
            if ($@) {
114
                warn "Unable to parse UpdateItemWhenLostFromHoldList syspref : $@" if $@;
115
                warn "Unable to parse UpdateItemWhenLostFromHoldList syspref : $@" if $@;
115
            }
116
            }
(-)a/cpanfile (-1 / +1 lines)
Lines 129-135 requires 'XML::RSS', '1.31'; Link Here
129
requires 'XML::SAX::ParserFactory', '1.01';
129
requires 'XML::SAX::ParserFactory', '1.01';
130
requires 'XML::SAX::Writer', '0.44';
130
requires 'XML::SAX::Writer', '0.44';
131
requires 'XML::Simple', '2.14';
131
requires 'XML::Simple', '2.14';
132
requires 'YAML', '0.71';
132
requires 'YAML::XS', '0.71';
133
requires 'YAML::Syck', '0.71';
133
requires 'YAML::Syck', '0.71';
134
recommends 'AnyEvent', '5.0';
134
recommends 'AnyEvent', '5.0';
135
recommends 'AnyEvent::HTTP', '2.13';
135
recommends 'AnyEvent::HTTP', '2.13';
(-)a/misc/maintenance/fix_mysql_constraints.pl (-1 lines)
Lines 28-34 BEGIN { Link Here
28
28
29
use Getopt::Long;
29
use Getopt::Long;
30
use Pod::Usage;
30
use Pod::Usage;
31
use YAML;
32
use Try::Tiny;
31
use Try::Tiny;
33
use Koha::Script;
32
use Koha::Script;
34
use C4::Context;
33
use C4::Context;
(-)a/misc/migration_tools/bulkmarcimport.pl (-4 / +4 lines)
Lines 26-32 use C4::Charset; Link Here
26
use C4::Items;
26
use C4::Items;
27
use C4::MarcModificationTemplates;
27
use C4::MarcModificationTemplates;
28
28
29
use YAML;
29
use YAML::XS;
30
use Unicode::Normalize;
30
use Unicode::Normalize;
31
use Time::HiRes qw(gettimeofday);
31
use Time::HiRes qw(gettimeofday);
32
use Getopt::Long;
32
use Getopt::Long;
Lines 565-571 if ($logfile){ Link Here
565
}
565
}
566
if ($yamlfile) {
566
if ($yamlfile) {
567
    open my $yamlfileout, q{>}, "$yamlfile" or die "cannot open $yamlfile \n";
567
    open my $yamlfileout, q{>}, "$yamlfile" or die "cannot open $yamlfile \n";
568
    print $yamlfileout Dump($yamlhash);
568
    print $yamlfileout YAML::XS::Dump($yamlhash);
569
}
569
}
570
exit 0;
570
exit 0;
571
571
Lines 631-639 sub printlog{ Link Here
631
sub get_heading_fields{
631
sub get_heading_fields{
632
    my $headingfields;
632
    my $headingfields;
633
    if ($authtypes){
633
    if ($authtypes){
634
        $headingfields=YAML::LoadFile($authtypes);
634
        $headingfields = YAML::XS::LoadFile($authtypes);
635
        $headingfields={C4::Context->preference('marcflavour')=>$headingfields};
635
        $headingfields={C4::Context->preference('marcflavour')=>$headingfields};
636
        $debug && warn YAML::Dump($headingfields);
636
        $debug && warn YAML::XS::Dump($headingfields);
637
    }
637
    }
638
    unless ($headingfields){
638
    unless ($headingfields){
639
        $headingfields=$dbh->selectall_hashref("SELECT auth_tag_to_report, authtypecode from auth_types",'auth_tag_to_report',{Slice=>{}});
639
        $headingfields=$dbh->selectall_hashref("SELECT auth_tag_to_report, authtypecode from auth_types",'auth_tag_to_report',{Slice=>{}});
(-)a/misc/migration_tools/ifla/update.pl (-6 / +6 lines)
Lines 24-30 use File::Basename; Link Here
24
use FindBin qw($Bin);
24
use FindBin qw($Bin);
25
use Getopt::Long;
25
use Getopt::Long;
26
use Locale::PO;
26
use Locale::PO;
27
use YAML qw(LoadFile);
27
use YAML::XS;
28
use utf8;
28
use utf8;
29
29
30
use Koha::Database;
30
use Koha::Database;
Lines 68-84 EOT Link Here
68
    exit 0;
68
    exit 0;
69
}
69
}
70
70
71
my $defaults = LoadFile("$Bin/data/defaults.yml");
71
my $defaults = YAML::XS::LoadFile("$Bin/data/defaults.yml");
72
my $authorised_values = LoadFile("$Bin/data/authorised_values.yml");
72
my $authorised_values = YAML::XS::LoadFile("$Bin/data/authorised_values.yml");
73
my $authtypes = LoadFile("$Bin/data/authtypes.yml");
73
my $authtypes = YAML::XS::LoadFile("$Bin/data/authtypes.yml");
74
my @authtags;
74
my @authtags;
75
my @authsubfields;
75
my @authsubfields;
76
for my $authfw (qw(default CLASS CO EXP FAM GENRE_FORM NP NTEXP NTWORK PA PERS PUB SAUTTIT SNC SNG TM TU WORK)) {
76
for my $authfw (qw(default CLASS CO EXP FAM GENRE_FORM NP NTEXP NTWORK PA PERS PUB SAUTTIT SNC SNG TM TU WORK)) {
77
    my $file = LoadFile("$Bin/data/auth/$authfw.yml");
77
    my $file = YAML::XS::LoadFile("$Bin/data/auth/$authfw.yml");
78
    push @authtags, @{ $file->{authtags} };
78
    push @authtags, @{ $file->{authtags} };
79
    push @authsubfields, @{ $file->{authsubfields} };
79
    push @authsubfields, @{ $file->{authsubfields} };
80
}
80
}
81
my $biblio = LoadFile("$Bin/data/biblio/default.yml");
81
my $biblio = YAML::XS::LoadFile("$Bin/data/biblio/default.yml");
82
my @tags = @{ $biblio->{tags} };
82
my @tags = @{ $biblio->{tags} };
83
my @subfields = @{ $biblio->{subfields} };
83
my @subfields = @{ $biblio->{subfields} };
84
84
(-)a/misc/search_tools/export_elasticsearch_mappings.pl (-2 / +2 lines)
Lines 59-65 use Koha::SearchFields; Link Here
59
use Koha::SearchMarcMaps;
59
use Koha::SearchMarcMaps;
60
use Koha::SearchEngine::Elasticsearch;
60
use Koha::SearchEngine::Elasticsearch;
61
61
62
use YAML;
62
use YAML::XS;
63
use Getopt::Long;
63
use Getopt::Long;
64
use Pod::Usage;
64
use Pod::Usage;
65
65
Lines 81-84 if ( $type && $type !~ /^(marc21|unimarc|normarc)$/ ) { Link Here
81
my $mappings = Koha::SearchEngine::Elasticsearch::raw_elasticsearch_mappings( $type );
81
my $mappings = Koha::SearchEngine::Elasticsearch::raw_elasticsearch_mappings( $type );
82
82
83
binmode STDOUT, ":encoding(UTF-8)";
83
binmode STDOUT, ":encoding(UTF-8)";
84
print Dump($mappings);
84
print YAML::XS::Dump($mappings);
(-)a/opac/opac-ISBDdetail.pl (-1 / +2 lines)
Lines 40-45 the items attached to the biblio Link Here
40
=cut
40
=cut
41
41
42
use Modern::Perl;
42
use Modern::Perl;
43
use YAML::XS;
43
44
44
use C4::Auth;
45
use C4::Auth;
45
use C4::Context;
46
use C4::Context;
Lines 82-88 my $patron = Koha::Patrons->find($loggedinuser); Link Here
82
my $opachiddenitems_rules;
83
my $opachiddenitems_rules;
83
eval {
84
eval {
84
    my $yaml = C4::Context->preference('OpacHiddenItems') . "\n\n";
85
    my $yaml = C4::Context->preference('OpacHiddenItems') . "\n\n";
85
    $opachiddenitems_rules = YAML::Load($yaml);
86
    $opachiddenitems_rules = YAML::XS::Load($yaml);
86
};
87
};
87
88
88
unless ( $patron and $patron->category->override_hidden_items ) {
89
unless ( $patron and $patron->category->override_hidden_items ) {
(-)a/opac/opac-search.pl (-1 / +2 lines)
Lines 30-35 use Modern::Perl; Link Here
30
use C4::Context;
30
use C4::Context;
31
use List::MoreUtils q/any/;
31
use List::MoreUtils q/any/;
32
use Try::Tiny;
32
use Try::Tiny;
33
use YAML::XS;
33
34
34
use Data::Dumper; # TODO remove
35
use Data::Dumper; # TODO remove
35
36
Lines 245-251 my $yaml = C4::Context->preference('OpacHiddenItems'); Link Here
245
if ( $yaml =~ /\S/ ) {
246
if ( $yaml =~ /\S/ ) {
246
    $yaml = "$yaml\n\n"; # YAML expects trailing newline. Surplus does not hurt.
247
    $yaml = "$yaml\n\n"; # YAML expects trailing newline. Surplus does not hurt.
247
    eval {
248
    eval {
248
        $hidingrules = YAML::Load($yaml);
249
        $hidingrules = YAML::XS::Load($yaml);
249
    };
250
    };
250
    if ($@) {
251
    if ($@) {
251
        warn "Unable to parse OpacHiddenItems syspref : $@";
252
        warn "Unable to parse OpacHiddenItems syspref : $@";
(-)a/reports/reserves_stats.pl (-2 / +2 lines)
Lines 34-40 use Koha::ItemTypes; Link Here
34
use Koha::Libraries;
34
use Koha::Libraries;
35
use Koha::Patron::Categories;
35
use Koha::Patron::Categories;
36
use List::MoreUtils qw/any/;
36
use List::MoreUtils qw/any/;
37
use YAML;
37
use YAML::XS;
38
38
39
=head1 NAME
39
=head1 NAME
40
40
Lines 218-224 sub calculate { Link Here
218
	my @sqlorparams;
218
	my @sqlorparams;
219
	my @sqlor;
219
	my @sqlor;
220
	my @sqlwhere;
220
	my @sqlwhere;
221
	($debug) and print STDERR Dump($filters_hashref);
221
    ($debug) and print STDERR YAML::XS::Dump($filters_hashref);
222
	foreach my $filter (keys %$filters_hashref){
222
	foreach my $filter (keys %$filters_hashref){
223
		my $string;
223
		my $string;
224
		my $stringfield=$filter;
224
		my $stringfield=$filter;
(-)a/t/Context.t (-2 / +2 lines)
Lines 21-27 use DBI; Link Here
21
use Test::More tests => 35;
21
use Test::More tests => 35;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
use YAML;
24
use YAML::XS;
25
25
26
use t::lib::Mocks;
26
use t::lib::Mocks;
27
27
Lines 36-42 subtest 'yaml_preference() tests' => sub { Link Here
36
    my $data = [ 'uno', 'dos', { 'tres' => 'cuatro' } ];
36
    my $data = [ 'uno', 'dos', { 'tres' => 'cuatro' } ];
37
37
38
    my $context = Test::MockModule->new( 'C4::Context' );
38
    my $context = Test::MockModule->new( 'C4::Context' );
39
    $context->mock( 'preference', YAML::Dump($data) );
39
    $context->mock( 'preference', YAML::XS::Dump($data) );
40
40
41
    my $pref = C4::Context->new->yaml_preference( 'nothing' );
41
    my $pref = C4::Context->new->yaml_preference( 'nothing' );
42
42
(-)a/t/Installer_PerlModules.t (-1 / +1 lines)
Lines 16-22 ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object'); Link Here
16
my $prereq_pm = $modules->prereq_pm();
16
my $prereq_pm = $modules->prereq_pm();
17
ok (exists($prereq_pm->{"DBI"}), 'DBI required for installer to run');
17
ok (exists($prereq_pm->{"DBI"}), 'DBI required for installer to run');
18
ok (exists($prereq_pm->{"CGI"}), 'CGI required for installer to run' );
18
ok (exists($prereq_pm->{"CGI"}), 'CGI required for installer to run' );
19
ok (exists($prereq_pm->{"YAML"}), 'YAML required for installer to run');
19
ok (exists($prereq_pm->{"YAML::XS"}), 'YAML::XS required for installer to run');
20
20
21
subtest 'versions_info' => sub {
21
subtest 'versions_info' => sub {
22
    plan tests => 4;
22
    plan tests => 4;
(-)a/t/db_dependent/Budgets.t (-2 lines)
Lines 20-27 use t::lib::TestBuilder; Link Here
20
use t::lib::Mocks;
20
use t::lib::Mocks;
21
use Koha::DateUtils;
21
use Koha::DateUtils;
22
22
23
use YAML;
24
25
use t::lib::Mocks;
23
use t::lib::Mocks;
26
t::lib::Mocks::mock_preference('OrderPriceRounding','');
24
t::lib::Mocks::mock_preference('OrderPriceRounding','');
27
25
(-)a/t/db_dependent/Koha/Z3950Responder/GenericSession.t (-2 / +2 lines)
Lines 11-17 use File::Basename; Link Here
11
use File::Copy;
11
use File::Copy;
12
use FindBin qw($Bin);
12
use FindBin qw($Bin);
13
use XML::LibXML;
13
use XML::LibXML;
14
use YAML;
14
use YAML::XS;
15
use ZOOM;
15
use ZOOM;
16
16
17
BEGIN {
17
BEGIN {
Lines 51-57 subtest 'test_search' => sub { Link Here
51
        MARC::Field->new('999', '', '', c => '1234567'),
51
        MARC::Field->new('999', '', '', c => '1234567'),
52
    );
52
    );
53
53
54
    my $yaml = Test::MockModule->new('YAML');
54
    my $yaml = Test::MockModule->new('YAML::XS');
55
    $yaml->mock('LoadFile', sub {
55
    $yaml->mock('LoadFile', sub {
56
        return {
56
        return {
57
            biblios => {
57
            biblios => {
(-)a/t/db_dependent/Koha/Z3950Responder/ZebraSession.t (-1 lines)
Lines 6-12 use Test::More tests => 3; Link Here
6
use Test::MockObject;
6
use Test::MockObject;
7
use t::lib::Mocks qw(mock_preference);
7
use t::lib::Mocks qw(mock_preference);
8
8
9
use YAML;
10
use ZOOM;
9
use ZOOM;
11
10
12
BEGIN {
11
BEGIN {
(-)a/t/db_dependent/OAI/Server.t (-4 / +4 lines)
Lines 27-33 use File::Spec; Link Here
27
use Test::MockModule;
27
use Test::MockModule;
28
use Test::Warn;
28
use Test::Warn;
29
use XML::Simple;
29
use XML::Simple;
30
use YAML;
30
use YAML::XS;
31
31
32
use t::lib::Mocks;
32
use t::lib::Mocks;
33
33
Lines 176-184 sub test_query { Link Here
176
    delete $response->{responseDate};
176
    delete $response->{responseDate};
177
    unless (is_deeply($response, \%full_expected, $test)) {
177
    unless (is_deeply($response, \%full_expected, $test)) {
178
        diag
178
        diag
179
            "PARAM:" . Dump($param) .
179
            "PARAM:" . YAML::XS::Dump($param) .
180
            "EXPECTED:" . Dump(\%full_expected) .
180
            "EXPECTED:" . YAML::XS::Dump(\%full_expected) .
181
            "RESPONSE:" . Dump($response);
181
            "RESPONSE:" . YAML::XS::Dump($response);
182
    }
182
    }
183
}
183
}
184
184
(-)a/t/db_dependent/Search.t (-2 lines)
Lines 19-26 use Modern::Perl; Link Here
19
19
20
use utf8;
20
use utf8;
21
21
22
use YAML;
23
24
use C4::Debug;
22
use C4::Debug;
25
use C4::AuthoritiesMarc qw( SearchAuthorities );
23
use C4::AuthoritiesMarc qw( SearchAuthorities );
26
use C4::XSLT;
24
use C4::XSLT;
(-)a/t/db_dependent/Serials.t (-1 lines)
Lines 4-10 Link Here
4
# Add more tests here!!!
4
# Add more tests here!!!
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
use YAML;
8
7
9
use C4::Serials;
8
use C4::Serials;
10
use C4::Serials::Frequency;
9
use C4::Serials::Frequency;
(-)a/xt/sample_notices.t (-1 lines)
Lines 78-84 sub compare_notices { Link Here
78
       open( my $trans_fh,"<", "$root_dir/$trans_file" ),
78
       open( my $trans_fh,"<", "$root_dir/$trans_file" ),
79
       "Open translated sample notices file $root_dir/$trans_file" );
79
       "Open translated sample notices file $root_dir/$trans_file" );
80
    my $trans_notice = get_notices_from_sql_file( $trans_fh );
80
    my $trans_notice = get_notices_from_sql_file( $trans_fh );
81
    use YAML;
82
    my @trans_notices = sort { lc $a cmp lc $b } keys %$trans_notice;
81
    my @trans_notices = sort { lc $a cmp lc $b } keys %$trans_notice;
83
    cmp_ok(
82
    cmp_ok(
84
        $#trans_notices, '>=', 0,
83
        $#trans_notices, '>=', 0,
(-)a/xt/yaml_valid.pl (-3 / +2 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Getopt::Long;
21
use Getopt::Long;
22
use YAML;
22
use YAML::XS;
23
23
24
my $usage = <<EOF;
24
my $usage = <<EOF;
25
yaml_valid.pl - give it a filename and it will told you if it is an exact yaml file.
25
yaml_valid.pl - give it a filename and it will told you if it is an exact yaml file.
Lines 39-45 GetOptions( Link Here
39
die $usage if $help;
39
die $usage if $help;
40
40
41
say "Testing file: $file";
41
say "Testing file: $file";
42
eval { YAML::LoadFile($file); };
42
eval { YAML::XS::LoadFile($file); };
43
if ($@) {
43
if ($@) {
44
    print "KO!\n$@\n";
44
    print "KO!\n$@\n";
45
}
45
}
46
- 

Return to bug 27673