This happens consistently with different files and quantities of files...
I just created a disknode with these 4 different items...

upload_test/Einstein.gif
upload_test/SuburbanTrunkmonkeyAd.mpeg
upload_test/outpost_gerbil_cannon.avi
upload_test/he-man.mov

here is what it creates... and it works fine, except the file list gets screwed up.

Your disknode was created.
Submitted by droopy on Thu, 2006-04-06 13:36.

» he-man.mov (0 downloads | 19.48 MB) | he-man.mov (0 downloads | 19.48 MB) | he-man.mov (0 downloads | 19.48 MB) | he-man.mov (0 downloads | 19.48 MB)

When you edit the disknode, the file list shows

upload_test/he-man.mov
upload_test/he-man.mov
upload_test/he-man.mov
upload_test/he-man.mov

I originally left the disknode settings alone, but then tried entering in a base path. I didn't enable the experimental options. I'm running 4.6.6 and the latest disknode 4.6.0 module as of today. My mind is rather fried right now with a caffeine headache, so i know i probably forgot to tell you something you need. I apologize in advance. I've searched for 2 days on this, but didn't find very many issues with disknode to begin with... Of course, the ZIP unpacking functionality would solve my issues :)

CommentFileSizeAuthor
#4 disknode-filelist-fix.patch722 bytesrblomme@drupal.org

Comments

elmuerte’s picture

I'm unable to reproduce this. I will try to dig a bit further to find a probable cause.

fagath’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev
Component: User interface » Code
Assigned: Unassigned » fagath
Status: Active » Needs review

Well I repeated that bug with the current config :
drupal 4.7.0
Apache/2.0.54
PHP Version 5.0.4
Mysql 4.1.12-Max
OS Mandriva Linux 2006 (kernel 2.6.12)

I think I found a solution (a least it works for me )

I just did a little change on line 283 in disknode.inc file

I replaced :

if (!$validate) $node->disknodefiles[] = $file;

by

if (!$validate){ 
		$node->disknodefiles[] = $file;
		unset($file);}



 

rblomme@drupal.org’s picture

I have the same problem in cvs DRUPAL-4-7
// $Id: disknode.inc,v 1.1.4.20 2006/08/15 08:36:08 elmuerte Exp $

The fix in #2 solves my problem.

rblomme@drupal.org’s picture

Version: 4.7.x-1.x-dev » master
StatusFileSize
new722 bytes

patch in attachment

eliza411’s picture

This worked for me, too. Thanks so much for posting the solution.

I hope it makes it into the module code.

mooffie’s picture

Title: file list repeats last entry » PHP5: file list repeats last entry
Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

This problem only occurs in PHP5 because objects in PHP5 are copied by reference (whereas in PHP4 they are cloned).

mooffie’s picture

Assigned: fagath » mooffie
Status: Reviewed & tested by the community » Fixed

Fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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