Closed (fixed)
Project:
Storm
Version:
6.x-1.x-dev
Component:
Storm Invoice
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2010 at 12:49 UTC
Updated:
8 Apr 2010 at 15:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
francewhoaOpening the PDF file is working from my end.
Could you attached your PDF file here so we can try opening it?
Which OS are your using? Windows, Mac, Ubuntu?
Comment #2
tchurch commentedI attach the PDF file.
The website is running on Linux and we're trying to open the PDF on Windows PCs.
We've tried it from 3 PCs running different versions of Windows and Acrobat Reader.
Comment #3
juliangb commentedConfirmed that I can't open the file attached in #2 either.
Is this something that you've had working on that install before?
Comment #4
tchurch commentedNo.
This is a new storm/drupal install and it's the first time we've looked at using the invoice module.
I downloaded and installed the library tcpdf and now the icons show up to create the PDF invoices.
Comment #5
juliangb commentedI've reproduced this on my installation too.
The email sends fine, its just the file that comes out doesn't open.
Comment #6
juliangb commentedHere's an initial patch with a few cleanups of the pdf, which may or may not help.
Comment #7
juliangb commentedThe patch from #6 shouldn't break anything but I don't think fixes anything.
Here are a few more cleanups.
Comment #8
juliangb commentedThat one causes errors.
Comment #9
juliangb commentedIt is never as complex as it seems.
I believe the project was merely that the filename was too long - meaning that one of the lines of the email header got wrapped.
This patch should solve all. It creates a shorter, more simple filename.
I've taken out all the cleanups - those can go in a different patch.
Please could someone test this to confirm that it is now working.
Comment #10
tchurch commentedI will test this later today when I get to my main machine.
Comment #11
tchurch commentedHi,
I managed to have a look.
The filename of the attachment is OK but it contains ' around the filename in the email.
I think I found the error in the storminvoice.admin.inc file
line 488
$params['body'] .= "Content-Disposition: attachment; filename='$pdffile_name'\n";
should be
$params['body'] .= "Content-Disposition: attachment; filename=$pdffile_name\n";
Then the attachment is seen as a PDF file and opens OK.
Comment #12
juliangb commentedPatch with that cleanup too.
Comment #13
tchurch commentedI've tested the 2 changes mentioned in #12 and the email attachment can now be opened.
Not sure if you want someone else to test it independently too.
Comment #14
juliangb commentedThanks for the review - should be fine if we're both happy. Committed.