"Could not access file: Could not access file:" On Thank You page

Started by jtwebb, February 27, 2012, 17:58:01 PM

Previous topic - Next topic

jtwebb

After a customer confirms the order and is taken to the "Thank you" page at the top of the page is "Could not access file: Could not access file:" I'm not sure where that's coming from. I'm using the weight & county shipping plugin and the authorize.net payment plugin. I've commented out everything in the order_done.php file and still get the error so I know it's not coming from that. Any help would be greatly appreciated!

alatak

Hi,

It looks like the error comes from PhpMailer.
Is your mail server correctly configurated?

marcodelpercio

I was experiencing the same error and I took me quite long time to find out what it was and in the end I discovered it was Virtuemart 2. I was having this problem with my payment plugin so I suspected it was my fault, then I switched back to the default paypal payment plugin and I was facing the same error so I started investinating more...

I explain you what is happening and how I got it fixed:
The phpmailer of Joomla is trying for some reason to add an attchment to the email here in libraries/phpmailer/phpmailer.php in the AddAttachment() function.
I was surprised since the confirmation order email was triggering that and that email had absolutely no attachment.
That attachment is caused by Virtuemart 2 in  components/com_virtuemart/helpers/shopfunctionsf.php   in the  sendVmMail() function (in this case when using the FE invoice view for the confirmation order email)

In particular the root cause is here, around line 230:

if (isset($view->mediaToSend)) {
foreach ((array)$view->mediaToSend as $media) {
//Todo test and such things.
$mailer->addAttachment($media);
}
}


for some unkown reason Virtuemart 2 is detecting an empty "mediaToSend" and so it enters that if, trying to attach nothing and causing that error. It's very nice the code comment on that line "Todo test"... :-) the mediaToSend property on that view is an Array of 1 item containing nothing but that's enough for the isset function. I would recommend a further validation around that addAttachment!!!

I am on Joomla 2.5.1 and VM 2.0.2

Childitem


labossiere

So what is the fix? I have the file open and I am pretty good a tracking down the lines of code but I need to know how to do the work around to eliminate the issue as your explanation does not quite give details on how to correct this error.

Thanks

Virtumart 2.0.6
Joomla 1.5.4

http://www.greencoffeebeanextract800.com

alatak

Hi,

You have probably forgot to set up the path for sale in the VirtueMart configuration.
Go in Configuration>Configuration in the tab Template, and set the parameter Safe Path
It is the path where the invoices are going to be stored.

Childitem

I did set up a safe path. It's got something to do with mail.

Workaround: open en-GB.ini (or your language) en search for PHPMAILER_FILE_OPEN. Replace the message by "", or create an override via [Extensions, Language manager, Overrides].