Closed (fixed)
Project:
Filebrowser
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2006 at 18:09 UTC
Updated:
13 Jan 2007 at 21:57 UTC
Self explanatory. This modules generate a trio of related errors for each item it tries to display - and nothing is ever listed. It appears to be unusable with PHP5.
Comments
Comment #1
cosmicdreams commentedI concur. Here is the error messages I recieve:
Comment #2
cosmicdreams commentedline 245 is the contains the final arguments for this snippet of code:
Comment #3
cosmicdreams commentedsorry i meant 241
Comment #4
cosmicdreams commentedline 136 contains is apart of this code snippet:
Comment #5
buchanae commentedthis bug hasn't had much action, but in PHP 5 array_merge() takes only arrays for arguments. I think it is $extrainfo that causes this error, and a simple type cast "(array)" solves the error
Comment #6
jo1ene commentedChange this:
to this:
for a quick fix.
Comment #7
madhusker commented* dev-lang/php
Latest version available: 5.1.4
Latest version installed: 5.1.4
Size of downloaded files: 18,812 kB
Homepage: http://www.php.net/
Description: The PHP language runtime engine.
License: PHP-3
I made changes suggested above in #6 and still have this error listed below.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 244.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 244.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 244.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 244.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 244.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 137.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 137.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 137.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 137.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/modules/filebrowser/filebrowser.module on line 137.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/includes/theme.inc on line 749.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/includes/theme.inc on line 749.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/includes/theme.inc on line 749.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/includes/theme.inc on line 749.
* warning: Invalid argument supplied for foreach() in /var/www/www.mysite.org/htdocs/drupal/includes/theme.inc on line 749.
Any ideas?
Comment #8
pcwick commentedThe fix in #6 seems to have worked for me.
Comment #9
pcwick commentedDrupal 4.7.2
PHP 5.1.2
MySQL 5.0.18-standard-log
I spoke to soon. The fix in #6 works for files that are not in subdirectories. With the fix in #6, files listed in the first level directory appear in the list properly with icon and download without any problem. With the fix in #6, clicking on a subdirectory listed in the filebrowser produced these errors:
[code]
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /drupal/modules/filebrowser/filebrowser.module on line 259
Warning: Invalid argument supplied for foreach() in /drupal/modules/filebrowser/filebrowser.module on line 137
Warning: Invalid argument supplied for foreach() in /drupal/includes/theme.inc on line 749
[/code]
Despite the errors, the subdirectory opened and filebrowser listed the files properly, and the files downloaded without problem.
Following the pattern in #6, I changed my line 259 in filebrowser.module from this:
[code]
$details[] = array_merge(array(
array('data' => $link, 'class' => 'filename', 'sv' => $file),
array('data' => '', 'sv' => 0),
array('data' => '', 'sv' => 0)
), $extrainfo);
[/code]
to this:
[code]
$details[] = array_merge(array(
array('data' => $link, 'class' => 'filename', 'sv' => $file),
array('data' => '', 'sv' => 0),
array('data' => '', 'sv' => 0)
), array($extrainfo));
[/code]
Seems to have resolved the errors associated with clicking on subdirectories.
Comment #10
pcwick commentedThis should be easier to read.
Following the pattern in #6, I changed my line 259 in filebrowser.module from this:
to this:
Seems to have resolved the errors associated with clicking on subdirectories.
Comment #11
gábor hojtsyI have just committed some fixes into the HEAD (cvs) and 4.7 versions of filebrowser to support PHP 5 better. Please try with the latest module. Unfortunately I don't have a Drupal on PHP 5 at hand right now. The diffs for the HEAD and 4.7 versions are the same and quite simple:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/filebrowser/f...
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/filebrowser/f...
Do not apply the fix suggested here in #6, it will break other things.
Comment #12
gábor hojtsyTested with later filebrowser code and PHP 5 and found no array_merge() errors.