From 6e53814c58be68bf7392395896c7a66a40d12bd1 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 --- 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 425ff76552..2a82a85e64 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -452,7 +452,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} ); @@ -475,7 +475,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 ); @@ -560,7 +560,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 ) { @@ -591,7 +591,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 ) { @@ -1020,7 +1020,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); } @@ -1044,7 +1044,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} ); @@ -1071,7 +1071,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} ); @@ -1109,7 +1109,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} ); @@ -1179,7 +1179,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 ); } @@ -1230,7 +1230,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} ); @@ -1279,7 +1279,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 ); } @@ -1345,7 +1345,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} ); @@ -1430,7 +1430,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} ); @@ -1481,7 +1481,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} ); @@ -1573,7 +1573,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