Bugzilla – Attachment 144016 Details for
Bug 32242
The job has not been sent to the message broker: (Wide character in syswrite ... )
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32242: Resolve encoding issue when sending to Net::Stomp
Bug-32242-Resolve-encoding-issue-when-sending-to-N.patch (text/plain), 1.78 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-11-17 17:46:08 UTC
(
hide
)
Description:
Bug 32242: Resolve encoding issue when sending to Net::Stomp
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-11-17 17:46:08 UTC
Size:
1.78 KB
patch
obsolete
>From 022034a1c7b91adac539c7ed16fc7b48d566912e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 17 Nov 2022 09:29:42 +0000 >Subject: [PATCH] Bug 32242: Resolve encoding issue when sending to Net::Stomp > >This is meant as a quick fix. It should be enhanced later on by >letting Net::Stomp do the UTF8 conversion. > >Test plan: >Run batch mod items. Add a Unicode char in the notes. >Check if job runs and results are correct. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/BackgroundJob.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index 442ba77975f..727bc3b2f7b 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -16,6 +16,7 @@ package Koha::BackgroundJob; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use Encode qw(); > use JSON; > use Carp qw( croak ); > use Net::Stomp; >@@ -137,7 +138,8 @@ sub enqueue { > # Also, here we just want the Koha instance's name, but it's not in the config... > # Picking a random id (memcached_namespace) from the config > my $namespace = C4::Context->config('memcached_namespace'); >- $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s", $namespace, $job_queue), body => $json_args } ) >+ my $encoded_args = Encode::encode_utf8( $json_args ); # FIXME We should better leave this to Net::Stomp? >+ $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s", $namespace, $job_queue), body => $encoded_args } ) > or Koha::Exceptions::Exception->throw('Job has not been enqueued'); > } catch { > $self->status('failed')->store; >-- >2.34.1
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 32242
:
143986
|
143987
|
143994
|
143998
| 144016 |
144017
|
144772