Bug 8368 - List email broken for non english templates
Summary: List email broken for non english templates
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Frédéric Demians
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 9189
  Show dependency treegraph
 
Reported: 2012-07-05 13:42 UTC by Katrin Fischer
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

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


Attachments
Proposed patch (10.73 KB, patch)
2013-09-24 16:39 UTC, Frédéric Demians
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8368 List email broken for non english templates (11.10 KB, patch)
2013-09-25 15:14 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Proposed patch (v2 see Owen comment) (10.92 KB, patch)
2013-09-25 15:21 UTC, Frédéric Demians
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8368 List email broken for non english templates (11.02 KB, patch)
2013-09-25 17:53 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 8368 List email broken for non english templates (11.65 KB, patch)
2013-09-27 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2012-07-05 13:42:42 UTC
This is the same problem as for bug 8062 only for sending out lists.

Copying description with some changes:

To reproduce:
- Create a list that you can access
- Open list in OPAC or staff
- log in, if you didn't before
- Send list to any email address
- Check email text and attachements

The mail sent from the translated templates has subject "no subject" and is empty. The marc files are attached.

The mail sent from the english templates is all correct.
Comment 1 Frédéric Demians 2013-09-24 16:39:08 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-09-25 15:01:28 UTC
This works for me except where the template tries to show subtitles. I get something like this:

Swiss Family Robinson ARRAY(0xc0a58b4)

Your patch removes this:

- [% IF ( BIBLIO_RESULT.subtitle.size ) %] [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %][% subtitle.subfield %][% END %][% END %]

...in favor of this:

+ [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]

BIBLIO_RESULT.subtitle is not a simple variable, hence the way it was handled previously.
Comment 3 Bernardo Gonzalez Kriegel 2013-09-25 15:14:13 UTC Comment hidden (obsolete)
Comment 4 Frédéric Demians 2013-09-25 15:21:37 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2013-09-25 17:53:01 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2013-09-27 21:17:23 UTC
Created attachment 21529 [details] [review]
[PASSED QA] Bug 8368 List email broken for non english templates

This patch ports to list sending by email, the technic used in sending cart, ie
(1) format email in HTML, and (2) transform it into Text with TT filter
html2text.

Note: V2 of this patch: Restore proper subtile display.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes a very annoying translation bug successfully.
Also passes all tests and QA script.

To test:
- Add a few records to a shelf, ideally use some with diacritics.
- Send shelf from English templates, verify email is ok
- Send shelf from translated templates (de-DE or similar) - verify
  email content is broken.
- Apply patches, update po files and reinstall the language.
- Send shelf from English templates again, verify there is no
  regression.
- Send shelf form translates templates - verify this email is now
  also working correctly.

Patch also changes the name of the file attachement from shelf.iso2709
to list.iso2709.
Comment 7 Galen Charlton 2013-10-18 07:29:51 UTC
Pushed to master, along with follow-ups to restore the display of ISBNs in the email, porting the template change to the new Bootstrap theme, and restoring the use of encode_qp().  Thanks, Frédéric!

As a side note, perhaps the email templates should probably be moved outside of the OPAC theme template directories.
Comment 8 Katrin Fischer 2013-11-25 08:33:55 UTC
Hi Tomas, 
I think we shoudl have this in 3.12 as list emails are still broken there.
Could you consider for your next release?
Comment 9 Tomás Cohen Arazi 2013-12-05 13:01:40 UTC
This patch has been pushed to 3.12.x, will be in 3.12.8.

Thanks Frederic!