Archive function can't write outside drupal files directory
jeremdow - February 4, 2009 - 15:26
| Project: | Ubercart EDI |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
uc_edi_archive_file uses the file_move api function, so you can't archive your edi files to a non-public folder in your home directory - even though you can export them there.
Using rename() instead of file_move() will fix this - as below:
function uc_edi_archive_file($filename = ''){
$source = variable_get('uc_edi_order_export_dir', '') .'/'. $filename;
$destination = variable_get('uc_edi_order_export_archive_dir', '') . $filename;
if (rename($source, $destination)){
drupal_set_message(t('Order EDI export file %file was archived successfully.', array('%file' => $filename)));
}
drupal_goto('admin/store/orders/edi/download');
}| Attachment | Size |
|---|---|
| uc_edi.archive.patch | 722 bytes |

#1
oops - bad patch - reattached.