From cacaebca32de1baa70a0e0ca57d3618a900d5046 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 10 Apr 2020 06:58:43 -0400 Subject: [PATCH] Bug 25107: Remove double passing of $server variable to maybe_add in C4::SIP::Sip::MsgType MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit At some point some calls to maybe_add got an extra $server var in their parameter lists. This doubled parameter does nothing and should be removed. Test Plan: No change in behavior should be noted Signed-off-by: Frédéric Demians Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize (cherry picked from commit 6e53814c58be68bf7392395896c7a66a40d12bd1) Signed-off-by: Lucas Gass --- C4/SIP/Sip/MsgType.pm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index 344e71a898..4ab564c932 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -439,7 +439,7 @@ sub build_patron_status { my $msg = $patron->screen_msg; $msg .= ' -- '. INVALID_PW if $patron_pwd && !$password_rc; - $resp .= maybe_add( FID_SCREEN_MSG, $msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $msg, $server ); $resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server ) if ( $server->{account}->{send_patron_home_library_in_af} ); @@ -462,7 +462,7 @@ sub build_patron_status { ( $protocol_version >= 2 ) and $resp .= add_field( FID_VALID_PATRON, 'N', $server ); - $resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); } $resp .= add_field( FID_INST_ID, $fields->{ (FID_INST_ID) }, $server ); @@ -547,7 +547,7 @@ sub handle_checkout { $resp .= add_field( FID_DUE_DATE, q{}, $server ); } - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); if ( $protocol_version >= 2 ) { @@ -578,7 +578,7 @@ sub handle_checkout { # it's not due, so leave the date blank $resp .= add_field( FID_DUE_DATE, '', $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); if ( $protocol_version >= 2 ) { @@ -1007,7 +1007,7 @@ sub handle_patron_info { if( defined( $patron_pwd ) && !$password_rc ) { $msg .= ' -- ' . INVALID_PW; } - $resp .= maybe_add( FID_SCREEN_MSG, $msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $msg, $server ); if ( $server->{account}->{send_patron_home_library_in_af} ) { $resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server); } @@ -1031,7 +1031,7 @@ sub handle_patron_info { if ( $protocol_version >= 2 ) { $resp .= add_field( FID_VALID_PATRON, 'N', $server ); } - $resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); } $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1058,7 +1058,7 @@ sub handle_end_patron_session { $resp .= add_field( FID_INST_ID, $server->{ils}->institution, $server ); $resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) }, $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $print_line, $server ); $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1096,7 +1096,7 @@ sub handle_fee_paid { $resp .= add_field( FID_INST_ID, $inst_id, $server ); $resp .= add_field( FID_PATRON_ID, $patron_id, $server ); $resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id, $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1166,7 +1166,7 @@ sub handle_item_information { $resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i), $server ); } - $resp .= maybe_add( FID_SCREEN_MSG, $item->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $item->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $item->print_line, $server ); } @@ -1217,7 +1217,7 @@ sub handle_item_status_update { $resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); } - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1266,7 +1266,7 @@ sub handle_patron_enable { $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ), $server ); } $resp .= add_field( FID_VALID_PATRON, 'Y', $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $patron->print_line, $server ); } @@ -1332,7 +1332,7 @@ sub handle_hold { } $resp .= add_field( FID_INST_ID, $ils->institution, $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1417,7 +1417,7 @@ sub handle_renew { } $resp .= add_field( FID_INST_ID, $ils->institution, $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1468,7 +1468,7 @@ sub handle_renew_all { $resp .= join( '', map( add_field( FID_RENEWED_ITEMS, $_ ), @renewed ), $server ); $resp .= join( '', map( add_field( FID_UNRENEWED_ITEMS, $_ ), @unrenewed ), $server ); - $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); + $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); @@ -1560,7 +1560,7 @@ sub send_acs_status { $msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs, $server ); } - $msg .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server, $server ); + $msg .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); if ( defined( $account->{print_width} ) && defined($print_line) -- 2.39.5