Bug 29744: (QA follow-up) Call psgi_env in OO style
Result of git grep -l -E "::psgi_env" | xargs sed -i -e's/::psgi_env/->psgi_env/g'
Also resolving this warn from Auth.t:
Use of uninitialized value $ENV{"SCRIPT_NAME"} in pattern match (m//) at /usr/share/koha/Koha/AuthUtils.pm line 211.
Note that the following warn is resolved on report 30588 (underway).
Use of uninitialized value $return in numeric gt (>) at /usr/share/koha/C4/Auth.pm line 1154.
Test plan:
Run t/db_dependent/Auth.t
Hit some opac, intranet pages. API call.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
097b2afb17
commit
179be45f4a
|
|
@ -81,7 +81,7 @@ sub get_login_shib {
|
|||
|
||||
my $matchAttribute = $config->{mapping}->{ $config->{matchpoint} }->{is};
|
||||
|
||||
if ( C4::Context::psgi_env ) {
|
||||
if ( C4::Context->psgi_env ) {
|
||||
return $ENV{"HTTP_".uc($matchAttribute)} || '';
|
||||
} else {
|
||||
return $ENV{$matchAttribute} || '';
|
||||
|
|
@ -126,7 +126,7 @@ sub _autocreate {
|
|||
my %borrower = ( $config->{matchpoint} => $match );
|
||||
|
||||
while ( my ( $key, $entry ) = each %{$config->{'mapping'}} ) {
|
||||
if ( C4::Context::psgi_env ) {
|
||||
if ( C4::Context->psgi_env ) {
|
||||
$borrower{$key} = ( $entry->{'is'} && $ENV{"HTTP_" . uc($entry->{'is'}) } ) || $entry->{'content'} || '';
|
||||
} else {
|
||||
$borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';
|
||||
|
|
@ -144,7 +144,7 @@ sub _sync {
|
|||
my %borrower;
|
||||
$borrower{'borrowernumber'} = $borrowernumber;
|
||||
while ( my ( $key, $entry ) = each %{$config->{'mapping'}} ) {
|
||||
if ( C4::Context::psgi_env ) {
|
||||
if ( C4::Context->psgi_env ) {
|
||||
$borrower{$key} = ( $entry->{'is'} && $ENV{"HTTP_" . uc($entry->{'is'}) } ) || $entry->{'content'} || '';
|
||||
} else {
|
||||
$borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ outside this context.
|
|||
=cut
|
||||
|
||||
sub get_script_name {
|
||||
if ( ( C4::Context::psgi_env ) && $ENV{SCRIPT_NAME} =~ m,^/(intranet|opac)(.*), ) {
|
||||
if ( ( C4::Context->psgi_env ) && $ENV{SCRIPT_NAME} && $ENV{SCRIPT_NAME} =~ m,^/(intranet|opac)(.*), ) {
|
||||
return '/cgi-bin/koha' . $2;
|
||||
} else {
|
||||
return $ENV{SCRIPT_NAME};
|
||||
|
|
|
|||
Loading…
Reference in New Issue