Call to duplicate_files failing

I'm running into an issue that has me stumped and am looking for any insight. We have a process that takes Attachments from Emails and allows users to copy selected Attachments to Documents that are then related to the parent of the email (Cases or Opportunities). This makes finding the files a bit easier.
The process works just fine in two sandbox environments (QA & UAT). However, once the code was deployed to a Dev sandbox, we started seeing errors.
The code is successfully creating the Document with Revision, all good. But once the call goes out to duplicate the file, it fails, and I cannot see why. This is the documentation followed for duplicating a file:
Some Notes:
  • File size is small: 562K, and Maximum upload size is set to 30MB.
  • We have plenty of free disk space according to SugarCloud Insights.
  • User permissions appear to be the same as other environments.
  • Not seeing any error entries in the logs from upload_file.php.
Interestingly, while we are calling duplicate_file from upload_file.php, I am seeing a warnings in the PHP logs from download_file.php.
PHP Warning:  Trying to access array offset on false in /25.2.0/ent/include/download_file.php on line 50
Our Dev sandbox was recently created from a Production backup, so my fear is that this process will also not work in Production.
If anyone has suggestions for where to look next it would be greatly appreciated.
Thank you,
Steve.
Parents
  • Andre,

    Thank you for the reply, it was much appreciated and sent me down the correct path.

    After checking with Sugar Support I now understand that when restoring a backup to a clone/sandbox, the upload files are not restored. The upload folder did exist, but no files. This makes complete sense when I think about it. So, while the emails appeared to have attachments, the files did not exist.

    I'll be adding code to properly handle this scenario.

    Thanks again,

    Steve.

Reply
  • Andre,

    Thank you for the reply, it was much appreciated and sent me down the correct path.

    After checking with Sugar Support I now understand that when restoring a backup to a clone/sandbox, the upload files are not restored. The upload folder did exist, but no files. This makes complete sense when I think about it. So, while the emails appeared to have attachments, the files did not exist.

    I'll be adding code to properly handle this scenario.

    Thanks again,

    Steve.

Children
No Data