View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
04906Bug reportsResponse browsingpublic2011-02-17 18:25
Reporterstarmonkey Assigned Totexens  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.91RC2 
Target Version1.91RC4Fixed in Version1.91RC4 
Summary04906: file_upload: downloadindividualfile files deletes them
Description

When browsing responses you can download file upload files individually from the browse table.

This deletes them because it has unlink.

Check the logic for "downloadindividualfile" in admin/browse.php

I commented it out and it works as expected.

readfile($file);
//unlink($file); // SM 26Jan11: Why remove the file?

This probably occured because the code was copy/pasted from the logic above it for downloading all of a responses files as a zip.

The benefits of abstraction!

Steps To Reproduce

1) Create survey with a file_upload question type
2) Submit a few responses and upload some files
3) Go to the admin/browse page, scroll to the right till you find the "File X" fields and click the linked name (which is actually a javascript post).
4) Repeat step 3 and you'll notice it fails now

Additional Information

The code in browse.php is in much need of refactoring. Push rendering functions into helper classes. In fact I'm noticing a lot of LS/191 is in a similar state.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)9672
I will donate to the project if issue is resolvedNo
BrowserFF
Database type & versionMySQL5
Server OS (if known)Windows7
Webserver software & version (if known)Apache2
PHP VersionPHP5

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-01-27 00:03

administrator   ~13989

Thank you starmonkey.
We will start refactoring code this summer and moving over to using CodeIgniter with MVC approach.

texens

texens

2011-02-03 16:46

reporter   ~14049

Fixed in r9742.
Thanks to starmonkey for reporting the bug and suggesting the fix :)

c_schmitz

c_schmitz

2011-02-17 18:25

administrator   ~14235

1.91RC4 released

Issue History

Date Modified Username Field Change
2011-01-27 00:00 starmonkey New Issue
2011-01-27 00:02 c_schmitz Assigned To => texens
2011-01-27 00:02 c_schmitz Status new => assigned
2011-01-27 00:03 c_schmitz Note Added: 13989
2011-02-01 16:15 mdekker Target Version => 1.91RC4
2011-02-03 16:46 texens Note Added: 14049
2011-02-03 16:46 texens Status assigned => resolved
2011-02-03 16:46 texens Fixed in Version => 1.91RC4
2011-02-03 16:46 texens Resolution open => fixed
2011-02-17 18:25 c_schmitz Note Added: 14235
2011-02-17 18:25 c_schmitz Status resolved => closed