Explicitly setting a MIME header field (content-type) is dangerous: use the attr() method instead. at misc/cronjobs/runreport.pl line 312. It seems the error comes from Koha/Email.pm: 72 $mail{'Content-Type'} = $params->{contenttype} if $params->{contenttype};
Created attachment 96383 [details] [review] Bug 22838: Remove MIME header warnings from runreports.pl Test plan: - create a savedsql report - run misc/cronjob/runreport.pl with options --format set to html and --to any email - check plack errors log, you should get a warning - apply patch - repeat runreport.pl step - check plack errors log, no additional warning there should be
Created attachment 96515 [details] [review] Bug 22838: Remove MIME header warnings from runreports.pl Test plan: - create a savedsql report - run misc/cronjob/runreport.pl with options --format set to html and --to any email - check plack errors log, you should get a warning - apply patch - repeat runreport.pl step - check plack errors log, no additional warning there should be Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 96641 [details] [review] Bug 22838: Specify a content-type for other formats
(In reply to Jonathan Druart from comment #3) > Created attachment 96641 [details] [review] [review] > Bug 22838: Specify a content-type for other formats What about this patch? Should not we set content-type for other formats as well?
Looking here
$msg->attr("content-type" => $contenttype); See first comment. This is not recommended. Normally you use Type in MIME::Lite. Furthermore it seems that the same content-type now is applied to both message and attachment. Obviously, they could be different and should be handled individually. This needs some more attention.
When we run runreport.pl with format option as html (koha version 19.11), we still obtain this warning : "Explicitly setting a MIME header field (content-type) is dangerous: use the attr() method instead. at runreport.pl line 326" We don't get it with format=csv. Olivier Crouzet
Hello, could someone have a look at this one? Thanks, Sonia
On master: kohadev-koha@kohadevbox:/kohadevbox/koha$ perl misc/cronjobs/runreport.pl 2 --format html --to foo@example.org It does not return any warnings. Certainly fixed by bug 22343. *** This bug has been marked as a duplicate of bug 22343 ***