Bugzilla – Attachment 120228 Details for
Bug 28230
Renewing/Checking out record with AE or OE letter in title can make Koha totally unfunctional
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28230: Store C4::Message->{metadata} as Perl string always
Bug-28230-Store-C4Message-metadata-as-Perl-string-.patch (text/plain), 2.28 KB, created by
Martin Renvoize (ashimema)
on 2021-04-27 13:38:23 UTC
(
hide
)
Description:
Bug 28230: Store C4::Message->{metadata} as Perl string always
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-04-27 13:38:23 UTC
Size:
2.28 KB
patch
obsolete
>From 462ec09fddd702006f8ad303b5f0e167fb4ae8c0 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Tue, 27 Apr 2021 10:29:21 +0300 >Subject: [PATCH] Bug 28230: Store C4::Message->{metadata} as Perl string > always > >When loading C4::Message->{metadata} we load it as perl string in all >other cases, see e.g. the subroutine find_last_message(). In this one >case we incorrectly populate the C4::Message->{metadata} as an UTF-8 >octet instead of a Perl string. This causes a problem later on because >encode_utf8 later on in the line: > >YAML::XS::Load(Encode::encode_utf8($self->{metadata})); > >excepts a perl string and not a UTF-8 octet (please refer to the >functions perldoc). This breaks the encoding and causes an internal >server error: > >To test the error is gone: >1. Create biblio with "AE" (bugzilla doesn't let me write the real >letter here, see it in the bugzilla comments) in title >2. Enable RenewalSendNotice >3. Enable "Item checkout and renewal" message preference for patron >4. Checkout an item from biblio "AE" to patron >5. Try to renew the patron's loan and notice the renewal fails >6. Apply patch and restart plack >7. Notice renewal works now and message h's the AE letter displayed correctly > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Message.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Message.pm b/C4/Message.pm >index 659ff96aeb..e10e3c594b 100644 >--- a/C4/Message.pm >+++ b/C4/Message.pm >@@ -166,7 +166,7 @@ sub enqueue { > my $body = join('', map { $format->($_) } @{$metadata->{body}}); > $letter->{content} = $metadata->{header} . $body . $metadata->{footer}; > >- $letter->{metadata} = Dump($metadata); >+ $letter->{metadata} = Encode::decode_utf8(Dump($metadata)); > C4::Letters::EnqueueLetter({ > letter => $letter, > borrowernumber => $borrower->{borrowernumber}, >@@ -279,7 +279,7 @@ sub metadata { > $data->{header} ||= ''; > $data->{body} ||= []; > $data->{footer} ||= ''; >- $self->{metadata} = Dump($data); >+ $self->{metadata} = Encode::decode_utf8(Dump($data)); > $self->content($self->render_metadata); > return $data; > } else { >-- >2.20.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 28230
:
120196
|
120202
|
120203
|
120204
|
120210
|
120211
|
120227
| 120228 |
120230