I'm regularly getting the following error in my log files:

Missing argument 1 for webfm_send_file() in ... webfm.module on line 2316

This is always followed by a page not found error .../webfm_send/

These 2 errors are always followed by an identical pair of the same errors.

I can reproduce the error in IE8:

  1. go to /webfm
  2. Click link to any .doc (Microsoft Word) file in webfm - this causes the standard Internet Exploror download blocker
  3. Click on the bar in IE and select "download file..." - this doesn't actually download the file but takes you back to /webfm
  4. Now click link to any .doc file in webfm again
  5. Click "open" in the dialogue box - this generates the 4 error messages above

I'm assuming my users are opening the files OK, I certainly can, even though the error messages are being generated.

Thanks for any help.

Adi

Comments

a.bond’s picture

I'm experiencing this issue also, is there any progress in fixing it?

nhck’s picture

Priority: Normal » Critical

I just tested this real quick and noticed that besides the described problem the path is also not created correctly.

cgmonroe’s picture

Priority: Critical » Minor

Did some tracing on this and found the following sequence in my access.log file.

10.123.10.135 - - [23/Mar/2010:13:04:00 -0400] "GET /webfm_send/13 HTTP/1.1" 200 21504
10.123.10.135 - - [23/Mar/2010:13:04:20 -0400] "OPTIONS /webfm_send/ HTTP/1.1" 404 6896
10.123.10.135 - - [23/Mar/2010:13:04:21 -0400] "HEAD /webfm_send/13 HTTP/1.1" 200 -

For some reason, IE is making an HTTP OPTIONS method (request for communication options) using the "directory URL", e.g. /webfm_send/ and not the full URL. This is being passed to the webfm_send function with out the required file id parameter. This causes the WARNING message about a function being called without a required parameter.

The download action occurs as it should via the GET command. Since IE (or Word Previewer?) is responsible for making the invalid request, the download requests works, and the message in the log is actually just a WARNING message, I'm downgrading this bug to minor.

If the message bothers you, here's a quick code change that will fix it:

// Add NULL default to $fid parameter
function webfm_send_file($fid = NULL, $download = false, $bypass_invoke = false) {
  global $user;

// Include check for missing argument and OPTIONS request  
  if ( ! $fid ) {
    if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
      drupal_set_header('HTTP/1.1 405 Method not allowed');
      return;
    }
    return drupal_not_found();
  }
nhck’s picture

Version: 6.x-2.11 » 6.x-2.x-dev
Status: Active » Closed (fixed)

Hello,
thank you for reporting this. In my opinion this shouldn't happen with the latest dev version anymore.

Thanks.

nhck’s picture

Status: Closed (fixed) » Closed (cannot reproduce)

Hello,
thank you for reporting this. In my opinion this shouldn't happen with the latest dev version anymore.

Thanks.