From e739db4000da7e34e73dd1566b5bc2214ea5376e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 13 Feb 2024 11:02:50 -0500 Subject: [PATCH] Bug 36051: (QA follow-up): Use yaml_preference Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- C4/SMS.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/C4/SMS.pm b/C4/SMS.pm index bcf2e5bbcc..eba203154c 100644 --- a/C4/SMS.pm +++ b/C4/SMS.pm @@ -114,15 +114,9 @@ sub send_sms { # Extract additional SMS::Send arguments from the syspref # Merge with any arguments from file with syspref taking precedence - my $sms_send_config_syspref = C4::Context->preference('SMSSendAdditionalOptions'); - if ( $sms_send_config_syspref ) { - require YAML::XS; - - $sms_send_config_syspref = "$sms_send_config_syspref\n\n"; - my $yaml; - eval { $yaml = YAML::XS::Load(Encode::encode_utf8($yaml)); }; - my %syspref_args = map { q{_} . $_ => $conf->{$_} } keys %$conf; - %args = ( %args, %syspref_args ); + if ( C4::Context->preference('SMSSendAdditionalOptions') ) { + my $sms_send_config_syspref = C4::Context->yaml_preference('SMSSendAdditionalOptions'); + %args = ( %args, %$sms_send_config_syspref ) if $sms_send_config_syspref; } eval { -- 2.39.5