EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #08639


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] set_lang on 3.4.3


Hi Mario,

For yours and other people's reference I have added this as a known issue with 3.4.3:

https://wiki.eprints.org/w/EPrints_3.4.3#Requesting_.2Fcgi.2Fset_lang_causes_an_internal_server_error

This gives bit more detail about which version of CGI::Cookie you need (tl;dr; Ubuntu 18.04/20.04 and RHEL/CentOS 8 have a recent enough version RHEL/CentOS 7 does not) and how to go about upgrading the CGI::Cookie package if necessary. 

I have made a few further amendments to SetLang.pm (see https://github.com/eprints/eprints3.4/commit/94aa768e930445c3b75c9a98f74cb35e8008939d).  This is not an essential patch, it just makes sure that if an invalid referrer (i.e. the URL to return to after setting the language) is set then it should take you back to the frontpage of the repository but this was broken and you would end up being stuck on the /cgi/set_lang.  This is not a major problem as it still loads the repository template so there should be a menu of links to navigate elsewhere.

Regards

David Newman

On 04/06/2021 17:58, Beaudoin, Mario wrote:
CAUTION: This e-mail originated outside the University of Southampton.

Hi David,

The patch does the job, everything works fine now

 

I do not have a recent version of CGI::Cookie Perl package installed.

 

Thank you,

 

MarioDe : eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> De la part de David R Newman via Eprints-tech
Envoyé : 2 juin 2021 13:36
À : Beaudoin, Mario via Eprints-tech <eprints-tech@ecs.soton.ac.uk>
Objet : Re: [EP-tech] set_lang on 3.4.3

 

Hi Mario,

This code relates to setting the correct attributes for the cookie EPrints uses to store the user's language preference.  This change was made to deal with the fact that FireFox was not going to continue to support the cookei for this in its current form. 

https://github.com/eprints/eprints3.4/issues/118

I am sure this worked when I tested but looking at it now I can see a couple of problems with it.  Maybe this was down to a merge that went bad.  Unfortunately, /cgi/set_lang was not part of my automated build testing prior to release but I will be adding it when I next get a chance.

I have added a patch to the GitHub code that should fix the specific issue you reported:

https://github.com/eprints/eprints3.4/commit/8c18cd49c65597539bd3fe9c1c97ef05c52694f7

However, to fix issue #118 you need to also make sure you have a recent version (I am on 4.51) of the CGI::Cookie Perl package installed, (i.e. most likely through installing using CPAN).  Otherwise, this fix to set_lang will likely not do anything useful (but should not make anything worse), as what it is trying to do is probably not supported by the version of CGI::Cookie you have installed.

Regards

David Newman

On 02/06/2021 17:18, Beaudoin, Mario via Eprints-tech wrote:

CAUTION: This e-mail originated outside the University of Southampton.

Hello,

I just upgrade my dev repository on 3.4.1 to 3.4.3,  and since I cannot change language with this code

<a href="">

I check the diff in file set_lang.pm with the 3.4.1 version and find that this piece of code does not work on my site

                if ( $session->{request}->scheme() eq "https" )

                {

                               my $samesite = "None";

                               my $secure = 1;

                               my $httponly = 0;

                }

If I comment this “if” loop everything work fine.  The site is https all the time.

Any idea why this code does not work on my repository.

 

Thanks,

 

Mario Beaudoin

 



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

 

Image supprimée par l'expéditeur.

Virus-free. www.avg.com