In the constructor for webfm_build_dir_list, an if-condition references an undefined variable, $webfm_root_path:

if (webfm_check_path($path, $webfm_root_path)) {
  $perm_flag = TRUE;
}

The resulting PHP warning is

Notice: Undefined variable: webfm_root_path in webfm_build_dir_list->webfm_build_dir_list() (line 2078 of sites/all/modules/webfm/webfm.module).

CommentFileSizeAuthor
#1 webfm.1038462.patch411 bytespillarsdotnet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pillarsdotnet’s picture

FileSize
411 bytes

Patch.

It should say $root instead of $webfm_root_path.

mshmsh5000’s picture

Super -- Looks great. Thank you.

mshmsh5000’s picture

Actually, this seems to cause all webfm_check_path() calls to return a blank string. Every AJAX directory listing call results in "invalid dir" now.

In any case, I don't see this change in 6.x-2.15. To get rid of the warning in the OP without breaking webfm_check_path(), I've added this in webfm_build_dir_list():

if ($perm == WEBFM_ADMIN) {
  // WEBFM_ADMIN always has access
  // Make sure $webfm_root_path exists.
  $webfm_root_path = (!isset($webfm_root_path)) ? '' : $webfm_root_path;
  if (webfm_check_path($path, $webfm_root_path)) {
    $perm_flag = TRUE;
  }
}

This check was always trivially succeeding; at least now it gets passed declared values.

nhck’s picture

Status: Active » Fixed

mshmsh5000, thank you for reporting this and helping to make webfm better. A fix has been commited to the dev version.

stephenplatz’s picture

This may be a related issue, I'm not able to set role root directories. The directories are created, but each time the form is submitted with the appropriate values, it returns that Role root directory is not set.

Status: Fixed » Closed (fixed)

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