6d1890fc8e
If you have EmailOverduesNoEmail = Send and specify "--html somedir", overdue_notices.pl will send a file by email that contains partial HTML, as a file called attachment.txt. This patch fixes that. To reproduce in koha-testing-docker: - EmailOverduesNoEmail = Send - Make sure you have a loan that was due yesterday, by backdating the due date - Set up an overdue action to send "Overdue Notice" (ODUE) to the category you made the loan to above, when a loan is one day overdue - Run this command: $ sudo koha-shell -c "perl misc/cronjobs/overdue_notices.pl -v -t -html /tmp/" kohadev - Look at the file /tmp/notices-<DATE>.html and make sure it is a full HTML document, with <html>, <head>, <body> etc. - Create a report like this: SELECT message_id, letter_id, borrowernumber, subject, CONCAT( '<pre>', content, '</pre>' ) AS content, metadata, letter_code, message_transport_type, time_queued, updated_on, to_address, content_type, failure_code FROM message_queue WHERE subject = 'Overdue Notices' ORDER BY message_id DESC - Run the report and verify there is a line like this in the "content" of the newest message: Content-Type: text/plain; name=attachment.txt - A part of the "content" will be a block of several lines of gibberish (base64) that look something like "RGVhciAga29oYSwNCg0KQWN...". Copy this block of text to somewhere like base64decode.org and decode the text. You should see a fragment of HTML, without <html>, <head>, <body> etc. To test: - Apply the patch - Run overdue_notices.pl again, with the same arguments as above - Make sure /tmp/notices-<DATE>.html is still a full HTML document - Re-run the report, and make sure you now have this in the "content": Content-Type: text/html; name=attachment.html - Decode the base64 and make sure it is now a full HTML document, with <html>, <head>, <body> etc. - Re-run overdue_notices.pl as above, but replace "-html /tmp/" with "-csv /tmp/test.csv" - Make sure /tmp/test.csv and the decoded base64 from the report contains CSV data - Re-run overdue_notices.pl as above, but replace "-html /tmp/" with "-text /tmp/" - Make sure /tmp/notices-<DATE>.txt and the decoded base64 from the report contains no HTML Note: - The actual text from the different messages will be enclosed in <pre>-tags - If you have HTML in your ODUE message template and run with -v, you will have warnings saying "The following terms were not matched and replaced" These are due to Bug 14347, and are not adressed by the current patch. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> |
||
---|---|---|
.. | ||
admin | ||
bin | ||
cronjobs | ||
devel | ||
interface_customization | ||
maintenance | ||
migration_tools | ||
release_notes | ||
search_tools | ||
translator | ||
workers | ||
add_date_fields_to_marc_records.pl | ||
add_statistics_borrowers_categorycode.pl | ||
batchCompareMARCvsFrameworks.pl | ||
batchdeletebiblios.pl | ||
batchDeleteUnusedSubfields.pl | ||
batchImportMARCWithBiblionumbers.pl | ||
batchRebuildBiblioTables.pl | ||
batchRebuildItemsTables.pl | ||
batchRepairMissingBiblionumbers.pl | ||
check_sysprefs.pl | ||
commit_file.pl | ||
export_borrowers.pl | ||
export_records.pl | ||
exportauth.pl | ||
import_patrons.pl | ||
koha-install-log | ||
link_bibs_to_authorities.pl | ||
load_yaml.pl | ||
mod_zebraqueue.pl | ||
perlmodule_ls.pl | ||
perlmodule_rm.pl | ||
process_ill_updates.pl | ||
recreateIssueStatistics.pl | ||
sax_parser_print.pl | ||
sax_parser_test.pl | ||
sip_cli_emulator.pl | ||
stage_file.pl | ||
z3950_responder.pl |