According to uc_file_api.php, the name of the hook is hook_uc_file_transfer_alter(), but it's never called. Instead, in file uc_file_pages.inc, we have at line 311:

// Check if any hook_file_transfer_alter calls alter the download.
  foreach (module_implements('file_transfer_alter') as $module) {
    $name = $module . '_file_transfer_alter';
    $file_user->full_path = $name($file_user, $ip, $file_user->fid, $file_user->full_path);
  }

Should be

// Check if any hook_uc_file_transfer_alter calls alter the download.
  foreach (module_implements('uc_file_transfer_alter') as $module) {
    $name = $module . '_uc_file_transfer_alter';
    $file_user->full_path = $name($file_user, $ip, $file_user->fid, $file_user->full_path);
  }

Comments

tr’s picture

Status: Active » Fixed

All the Ubercart hooks were renamed from hook_xxx() in D6 to hook_uc_xxx() in D7. While the documentation for this one was changed, it looks like the actual hook invocation never was. Thanks for catching that. I committed the fix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.