Project:Disk Node
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Ectar
Status:postponed (maintainer needs more info)

Issue Summary

Hi,
is this module still being maintained?
It has only a dev version...

I had some problems:
1) Could not browse any dirs except the base dir specified in options.
2) Whenever I clicked on info, I got "You are not allowed to operate outside the base environment set by the system operator".

I fixed these issues by editing disknode.inc in the module dir:

1) In function __disknode_sanitize_subdir() comment out the line
$subdir = preg_replace("#^".$fp.DIRECTORY_SEPARATOR."?"."(.*)$#", "\\1", file_create_path($subdir));
instead, add the line
$subdir = file_create_path($subdir);

2) In function _disknode_info() after the line
$file->mimetype = mime_content_type($fp);
add the line
$file->filepath = $fp;

My problems are solved, but you never know for how long.
My Qs to the devs are:

- Do my fixes make sense, how safe is it to keep them?
- Is this module still actively maintained?

Thanks

Comments

#1

Priority:normal» minor
Assigned to:Anonymous» Ectar
Status:active» postponed (maintainer needs more info)

1) I don't think it is bug! Do you want to have ability do go outside base folder? Why?

2) Connected to #1, only appear when you try to get info of files locate outside your Base dir.

This module is NOT actively maintained :)

#2

Hi there))

thanks for the answer, however, it was a little different for me than what you say:

1) In function __disknode_sanitize_subdir() comment out the line
$subdir = preg_replace("#^".$fp.DIRECTORY_SEPARATOR."?"."(.*)$#", "\\1", file_create_path($subdir));
instead, add the line
$subdir = file_create_path($subdir);

Before I did that, the browser that is used to select files for download was ALWAYS showing the base directory set in the module settings. If I clicked on a sub-directory, the page reloaded with the base directory again. My disknode base dir is a subdir of the Drupal filesystem base dir. So, I thought it is a bug. If not - what did I do wrong?

2) In function _disknode_info() after the line
$file->mimetype = mime_content_type($fp);
add the line
$file->filepath = $fp;

Same here, it did not work before, although I was within the base dir.

By the way:
I have made a few additions to the module. Just small things, mainly improving the output layout, and introducing related things like labels. Are you interested in me sending you the complete modified code so you can create a new official version of the module? Unfortunately, I do not currently have the time to offer you permanent help with maintaining the module.

Cheers!))

#3

Before I did that, the browser that is used to select files for download was ALWAYS showing the base directory set in the module settings. If I clicked on a sub-directory, the page reloaded with the base directory again

Strange in my demosite it works, probably there is something else to prevent this from operation well. This kind of behavior is obvious bug, but I cannot reproduce it. I think we need more detail to track it down. I tested both cases at my little website and I noticed that dir changes and info for files works well.

Regarding your changes: All improvements are welcomed and I greatly appreciated for any help! :) Can you please drop them here like feature request, all in one message... or sent me personal message?

nobody click here