From 00fb24d74b73225182263b1e06761853d6841a64 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 --- C4/SMS.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/C4/SMS.pm b/C4/SMS.pm index e3ecae3c167..37be6b8aac3 100644 --- a/C4/SMS.pm +++ b/C4/SMS.pm @@ -110,15 +110,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.30.2