Bug 8953 - opac-userupdate encoding issues
Summary: opac-userupdate encoding issues
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low critical
Assignee: Dobrica Pavlinusic
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-22 11:53 UTC by Dobrica Pavlinusic
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 8953 - opac-userupdate encoding issues (2.15 KB, patch)
2012-10-22 12:58 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 8953 - opac-userupdate encoding issues (2.21 KB, patch)
2012-10-22 13:25 UTC, Mirko Tietgen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Dobrica Pavlinusic 2012-10-22 11:53:17 UTC
When trying to edit user with utf-8 characters in one of user-editable fields we get following error:

Software error:

Wide character in subroutine entry at /usr/share/perl5/Mail/Sendmail.pm line 308.
Comment 1 Dobrica Pavlinusic 2012-10-22 12:58:37 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2012-10-22 13:25:26 UTC
Created attachment 12996 [details] [review]
Bug 8953 - opac-userupdate encoding issues

This script has various encoding problems:

1. parametars from CGI are not encoded in utf-8, so when they are
   compared with utf-8 strings from database every field with
   utf-8 characters will be reported in e-mail as changed
2. when sending e-mail, wide characters are passed to Mail::Sendmail
   which results in software error if edited field has utf-8 characters
   (because of first point, this happend if ANY fields has utf-8 chars)
3. when declaring encoding for outgoing e-mail utf-8 is more correct
   than just utf8

Test scenario:

1. open opac-userupdate and edit user which has utf-8 characters in
   at least one field (firstname and surname are common examples)
2. edit one of other fields and add utf-8 character to it
3. verify that e-mail with changes arrived with just edited field

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Comment 3 Mirko Tietgen 2012-10-22 13:30:41 UTC
Followed the test plan. Sendmail error without patch, no email sent. After applying the patch the email is sent, o error page.

BTW. I also have the patrons email address as changed in the email that is sent to the library (it was not really changed), no matter if I apply this patch or not. Is that normal?
Comment 4 Dobrica Pavlinusic 2012-10-22 13:56:36 UTC
Yes. In current implementation we are just sending e-mail with changes and expect librarians to enter changes through intranet manually from e-mail message (probably to have some kind of verification).

I used to have quick dirty change back in Koha 3.1 or so which would also save those changes in database, but then we changed our workflow and moved to newer version, so I never submited them to upstream or ported them to newer version. It would probably make sense to revisit that code, and wrap up that in proper improvement, but I can't promise any time-frame for that.
Comment 5 Katrin Fischer 2012-10-22 14:05:07 UTC
Hi Dobrica,

not related to this bug, but to your comment about getting rid of requiring manual changes - there is bug 7067 for patron self registration. I have not tested it myself, so I am not sure how it works. But the test plan looks a bit like what you might be looking for:

Test Plan - Part 2 - Borrower Modifications

1) Log in to OPAC, go to "my personal details" tab.
2) Make some modifications to your details.
3) Repeat steps 1 and 2 for two more borrowers.
4) Log in to Koha intranet with a user that can modify borrowers.
5) At the bottom of mainpage.pl, you should see:
  Patrons requesting modifications: 3
6) Click the link
7) Approve one change, deny a different one, and ignore the third, then submit.
8) Check the records, you should see the changes take affect on the approved one, and no changes to the other two. You should also see "Patrons requesting modifications: 1" at the bottom of mainpage.pl now.
Comment 6 Dobrica Pavlinusic 2012-10-22 14:56:45 UTC
Thanks Katrin, I wouldn't found it without your pointer. I will give it a try.

It seems that bug 7067 is targeting 3.12 so this bugfix might still be useful for older versions of Koha.
Comment 7 Katrin Fischer 2012-10-22 15:44:02 UTC
Yes, and I am glad you fixed it - I found the bug last week when training a library :)
Comment 8 Jonathan Druart 2012-10-24 14:08:11 UTC
utf-8 support for opac-userupdate

Marked as Passed QA.
Comment 9 Paul Poulain 2012-10-24 15:56:38 UTC
Patch pushed to master
Comment 10 Chris Cormack 2012-10-24 20:15:29 UTC
Pushed to 3.8.x will be in 3.8.7
Comment 11 Liz Rea 2012-11-18 23:50:44 UTC
Pushed to 3.6.x will be in 3.6.11.