Bugzilla – Attachment 127785 Details for
Bug 29516
Remove dependency on IO::Scalar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29516: Remove dependency on IO::Scalar
Bug-29516-Remove-dependency-on-IOScalar.patch (text/plain), 1.95 KB, created by
Julian Maurice
on 2021-11-18 11:43:50 UTC
(
hide
)
Description:
Bug 29516: Remove dependency on IO::Scalar
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2021-11-18 11:43:50 UTC
Size:
1.95 KB
patch
obsolete
>From 92062ff1f6bfcea4ab7019c3e3f7998a04d33eb3 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 18 Nov 2021 10:30:33 +0000 >Subject: [PATCH] Bug 29516: Remove dependency on IO::Scalar >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >IO::Scalar is used in Koha::App::Plugin::CGIBinKoha to create a >filehandle tied to a scalar. >Perl has this feature built in since 5.8.0 so IO::Scalar is not needed > >I'm not sure how to test this, since it should behave exactly the same >with or without the patch, but we can at least verify that it doesn't >introduce encoding issues. > >Test plan: >1. Run `morbo bin/intranet` >2. Go to http://localhost:3000 >3. Create a bibliographic record with some non-latin characters (try > emoji characters for instance). Verify that there is no visible > encoding issues. >4. Save this record as MARCXML and re-import it as a new record using > Tools » Stage MARC records for import. Verify that the new record has > no visible encoding issues >5. `git grep IO::Scalar` should not return any result >--- > Koha/App/Plugin/CGIBinKoha.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/App/Plugin/CGIBinKoha.pm b/Koha/App/Plugin/CGIBinKoha.pm >index b7b8d4680b..268c45fc7a 100644 >--- a/Koha/App/Plugin/CGIBinKoha.pm >+++ b/Koha/App/Plugin/CGIBinKoha.pm >@@ -24,7 +24,6 @@ use Mojo::Base 'Mojolicious::Plugin'; > use CGI; > use CGI::Compile; > use CGI::Emulate::PSGI; >-use IO::Scalar; > > sub register { > my ($self, $app, $conf) = @_; >@@ -80,9 +79,10 @@ sub _psgi_env { > my $env = $c->req->env; > > my $body = $c->req->build_body; >+ open my $input, '<', \$body or die "Can't open in-memory scalar: $!"; > $env = { > %$env, >- 'psgi.input' => IO::Scalar->new(\$body), >+ 'psgi.input' => $input, > 'psgi.errors' => *STDERR, > REQUEST_METHOD => $c->req->method, > QUERY_STRING => $c->req->url->query->to_string, >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29516
:
127785
|
128548