Bug 36826

Summary: Incorrect instantiations of CGI ::->
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dcook, julian.maurice, m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Jonathan Druart 2024-05-10 09:08:33 UTC
Koha/Uploader.pm:    my $query = CGI::->new( sub { $self->_hook(@_); }, {}, 0 );
opac/opac-retrieve-file.pl:my $input = CGI::->new;
tools/upload.pl:my $input  = CGI::->new;

This ::-> looks wrong
Comment 1 Marcel de Rooy 2024-05-13 07:24:02 UTC
(In reply to Jonathan Druart from comment #0)
> Koha/Uploader.pm:    my $query = CGI::->new( sub { $self->_hook(@_); }, {},
> 0 );
> opac/opac-retrieve-file.pl:my $input = CGI::->new;
> tools/upload.pl:my $input  = CGI::->new;
> 
> This ::-> looks wrong

It is not wrong. And theoretically perhaps even safer. But not consistent.
Comment 2 Julian Maurice 2024-05-13 07:33:03 UTC
Indeed it is correct: https://perldoc.perl.org/perlobj#Invoking-Class-Methods
Comment 3 Jonathan Druart 2024-05-21 09:55:00 UTC
Marking as invalid or we update for consistency?
Comment 4 Marcel de Rooy 2024-05-21 11:24:45 UTC
(In reply to Jonathan Druart from comment #3)
> Marking as invalid or we update for consistency?

If those three are the only ones, I would not mind updating.
Comment 5 David Cook 2024-05-21 23:38:16 UTC
(In reply to Julian Maurice from comment #2)
> Indeed it is correct: https://perldoc.perl.org/perlobj#Invoking-Class-Methods

Learn something new every day...