I want to offer an integrated file browsing, and the Filebrowser Module is quite exactly what I search, but I still don't get it to work as expected. I created a filebrowser page, however most of the files in the directory are not visible.
The only thing I can think of interacting with other modules is either i18n (I use path prefix) but this shouldn't be a problem, or maybe it doesn't work because of the Clean Urls.. However even then the module should be able to parse the directories correctly, and the funny thing is if you enter a directory which doesn't exist in the filebrowser you still can access it manually...
This is how it looks like:
http://apophis.ch/node/79
This is how it should look like:
http://download.apophis.ch/
I was a bit suspicious at first, because there are no bug reports like this, and this problem exists since at least 6 months, but still I cannot think of a normal problem anymore... The settings are normal, I havent't even touched the "blacklist"
But I activated recursion and private downloads (which don't change the behavior anyway)
BTW: There should be a notice that Private downloads have to be enabled when using an absolute Path ;)
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | filesbrowser.patch | 329 bytes | AliceInWonderland-1 |
| #1 | What filebrowser shows | 9.03 KB | kong |
| #1 | What are actually inside the directory | 13.68 KB | kong |
Comments
Comment #1
kong commentedI am having the same issue but it only happens with files named in Thai language -- I mean, Filebrowser displays all files but the ones that contain Thai character.
I'm running Drupal 6.6 using XAMPP on Windows XP
Please see screenshots in attachments.
Comment #2
Susurrus commentedThis is probably an issue with unicode characters, as it looks like the only ones showing are the only ASCII-using files. I'm not sure what the cause would be code-wise, but first guess that's what it is.
Comment #3
Yoran commentedNo news ? Is this still the case ?
Comment #4
kong commentedHi,
In my case, it seems Apache/PHP doesn't play well with Windows' file system encoding. So I moved my Drupal installation to a Linux server (Ubuntu, to be specific) and the problem was gone.
Comment #5
apophis.ch commentedWell I updated to rc8 tonight and now its not working at all, when you click the link above
First I though I did something wrong with the update.php so I checked the DB, but afaik it looks fine to me. (that my dump of filebrowser)
CREATE TABLE IF NOT EXISTS `filebrowser` (
`file_path` varchar(255) NOT NULL,
`explore_subdirs` tinyint(4) NOT NULL,
`nid` int(10) unsigned NOT NULL,
`private_downloads` tinyint(3) unsigned NOT NULL default '0',
`hidden_files` varchar(255) NOT NULL default '',
`filtered_files` varchar(255) NOT NULL default '',
`allowed_uploaded_files` varchar(255) NOT NULL default '',
`hide_extension` tinyint(4) NOT NULL default '0',
`visible_columns` varchar(255) NOT NULL default '',
PRIMARY KEY (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `filebrowser`
--
INSERT INTO `filebrowser` (`file_path`, `explore_subdirs`, `nid`, `private_downloads`, `hidden_files`, `filtered_files`, `allowed_uploaded_files`, `hide_extension`, `visible_columns`) VALUES
('/var/www/download', 1, 79, 1, '.*\r\ndescript.ion\r\nfile.bbs\r\nCVS', '', '', 0, 'a:4:{s:4:"size";s:4:"size";s:8:"modified";s:8:"modified";s:7:"created";i:0;s:4:"type";i:0;}');
---
So I looked at Error (warning: Invalid argument supplied for foreach() in /var/www/apophis-neXt/sites/all/modules/filebrowser/filebrowser.module on line 538.)
which is the following line: foreach ($node->file_listing as $file) {
So it probably protests because there is no data at all to be displayed. The Problem that there is no file at all is probably somewhere else. However I have no idea why it is doing this to me!
I also tried to delete the filebrowser module directory and add it again, the error is still the same.
Before you ask, www-data has the rights to access the files in /var/www/download , as you see apache can serve them on download.apophis.ch! I even tried to change it, nothing changed there!
should there be an admin page for settings? ;) can someone provide me the name of it? I dont find it in the adminstration menu, even when I sort by module, the only option it gives me is the permissions Settings.
Comment #6
Yoran commentedWell I'll have to test on windows. I didn't played with this OS for ages
Comment #7
Yoran commentedWhat OS are you using exactly ?
Comment #8
apophis.ch commentedThats a simple debian (etch updated to lenny, apache2)
Comment #9
apophis.ch commentedWell I updated to rc9 today, and its still:
warning: Invalid argument supplied for foreach() in /var/www/apophis-neXt/sites/all/modules/filebrowser/filebrowser.module on line 580.
Here -> http://apophis.ch/node/79
The path shows to this directory the internal directory /var/www/download/ which is here -> http://download.apophis.ch/
nothing changed
Comment #10
apophis.ch commentedOK what I found out:
in the function _filebrowser_load_files, at the end of that function I have the $files array with all the files which should be in there...
tehre that happens:
$cache[$relative_path]= & $files;
$node->file_listing= $files;
I did a print_r($node->file_listing), and all the files were in there...
when the fuction came to:
function theme_filebrowser_dir_listing(& $node) {
drupal_add_js(drupal_get_path("module", "filebrowser")."/filebrowser.js");
$files= & $node->file_listing;
// Manage empty folder
if (empty ($files)) {
return '
'.t('This directory is empty.').'
';
}
it seems that print_r($node->file_listing); is empty!!! But why? and why nobody else is experiencing it...
Thats also the reason why the warning comes, because $node->file_listing is null.
Comment #11
kong commented@apophis.ch:
Don't know if your case is the same as mine.
I used to get an empty directory listing and spent hours tried to figure out what happened.
It ends up that I had a custom template file named
filebrowser-dir-listing.tpl.phpin the current theme directory. I didn't remember when I created it, though.
This may or may not be the case for you, just want to let you know what I found out.
Comment #12
apophis.ch commentedNo I use a standard Garland Theme, and I didnt touch any files from the theme or the filebrowser plugin (beside the debugging effort above)
The really strange thing is I save the array to a dummy global variable which ended up empty aswell... (very strange)
But the fact is, the files get into the $files variable, but when the rendering happens the variable isn't set anymore.
Comment #13
Anders Östberg commentedI have the same problem, I get the warning and "This directory is empty" no matter what I try.
Has anyone found a solution?
(I'm on Windows).
Comment #14
AliceInWonderland-1 commentedHi @all,
In the case that the data is read from cache (at line 179 in filebrowser.module) the $files array is returned instead of stored in $node->file_listing.
The patch fixes the problem.
Comment #15
Anders Östberg commentedThanks!
It now sort of works though that immediately revealed a couple of other problems ... which should go into separate bug reports I guess.
Comment #16
Yoran commented@AliceInWonderland Thank you for the patch, this will be applied in RC10
Comment #17
Yoran commentedComment #18
Yoran commented