Bug 12637

Summary: UTF-8 problems when creating a patron list from the patron search results page
Product: Koha Reporter: Owen Leonard <oleonard>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, katrin.fischer, kyle.m.hall, kyle, m.de.rooy, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 11944, 13596    
Bug Blocks:    
Attachments: Bug 12637: UTF-8 problems when creating a patron list
[SIGNED-OFF] Bug 12637: UTF-8 problems when creating a patron list
Bug 12637: UTF-8 problems when creating a patron list

Description Owen Leonard 2014-07-23 14:28:57 UTC
Steps to reproduce:

1. Perform a patron search in the patrons module
2. Select one or more patrons
3. Choose "Add selected patrons to: [ New list ]"
4. Enter a patron list title with UTF-8 characters, ex: "Pàtron list five "
5. The list will be created with bad encoding: "P%C3%A0tron%20list%20five%20"
Comment 1 Owen Leonard 2014-07-23 14:36:26 UTC
Note that creating or editing a patron list via Tools -> Patron lists does not show the same problem.
Comment 2 Jonathan Druart 2014-07-24 08:53:36 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-07-24 08:54:16 UTC
This patch works on top of bug 11944. I didn't try against master.
Comment 4 Owen Leonard 2014-08-01 13:44:47 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2014-08-02 20:15:31 UTC
This doesn't work for me as a stand alone patch - my list was named "Testing ä list" and the 'ä' was broken after saving. When I tried to apply this on top of bug 11944 this bug no longer applied - moving this to BLOCKED for now.
Comment 6 Owen Leonard 2014-08-06 15:18:46 UTC
(In reply to Katrin Fischer from comment #5)
> This doesn't work for me as a stand alone patch

I tested this on top of the Biblibre branch for Bug 11944. Looks like the patch git generated when I signed off inserted an extra Content-Type line:

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"

It might work if you edit the extra line out. If anyone knows how I can prevent that from happening in the future please let me know.
Comment 7 Katrin Fischer 2014-08-06 15:33:17 UTC
Hi Owen, I think i should have used the branch maybe, instead of the patches from the bug. I missed that, the patch here applied ok.
Comment 8 Marcel de Rooy 2014-08-07 12:40:56 UTC
(In reply to Owen Leonard from comment #6)
> Looks like the
> patch git generated when I signed off inserted an extra Content-Type line:
> 
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Content-Type: text/plain; charset="utf-8"
> 
> It might work if you edit the extra line out. If anyone knows how I can
> prevent that from happening in the future please let me know.

This comes from accented characters in the commit message (in this case the character à in Pàtron). Your git version (and mine) cannot yet handle it correctly. I always see it when there is an accent in the name of somebody signing off a patch (and tend to remove it then).
Comment 9 Owen Leonard 2014-08-20 18:02:15 UTC
*** Bug 12524 has been marked as a duplicate of this bug. ***
Comment 10 Katrin Fischer 2014-12-27 16:07:51 UTC
I think this will have to wait for 11944 to make it in.
Comment 11 Tomás Cohen Arazi 2015-01-14 15:35:28 UTC
(In reply to Owen Leonard from comment #6)
> (In reply to Katrin Fischer from comment #5)
> > This doesn't work for me as a stand alone patch
> 
> I tested this on top of the Biblibre branch for Bug 11944. Looks like the
> patch git generated when I signed off inserted an extra Content-Type line:
> 
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Content-Type: text/plain; charset="utf-8"
> 
> It might work if you edit the extra line out. If anyone knows how I can
> prevent that from happening in the future please let me know.

This was a known bug in Git. I reported it, and a nice git developer fixed it.
Comment 12 Marcel de Rooy 2015-01-19 12:04:06 UTC
Created attachment 35374 [details] [review]
Bug 12637: UTF-8 problems when creating a patron list

Encoding problems appear when creating a patron list from the patron search results page.

Test plan:
1. Perform a patron search in the patrons module
2. Select one or more patrons
3. Choose "Add selected patrons to: [ New list ]"
4. Enter a patron list title with UTF-8 characters.
5. The list will be created with bad encoding.
6. Apply the patch and verify there is no bad encoding anymore.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Patch works fine.
Note that I - very ironically - had to remove UTF8 characters from the commit
message to apply and attach the patches with git/git-bz.
Hopefully, an upgrade to a newer git version will resolve that too.
Comment 13 Marcel de Rooy 2015-01-19 12:05:15 UTC
Passed QA
Comment 14 Tomás Cohen Arazi 2015-01-22 19:44:31 UTC
Patch pushed to master.

Thanks Jonathan!