View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05282Bug reportsSurvey takingpublic2011-06-21 14:31
ReporterTMSWhite Assigned ToTMSWhite  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91+ 
Summary05282: save.php error when trying to save a fileUpload field, but not file was uploaded
Description

LimeSurvey throws a save.php error, saying unknown object, if tries to save a survey when no file has been uploaded

Steps To Reproduce

Patch to fix the problem is attached

TagsNo tags attached.
Attached Files
save-fileupload-patch.patch (919 bytes)   
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\xampp\htdocs\limesurvey
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: save.php
--- save.php Base (BASE)
+++ save.php Locally Modified (Based On LOCAL)
@@ -500,7 +500,7 @@
                     // if the files have not been saved already,
                     // move the files from tmp to the files folder
                     
-                    if (file_exists("tmp/upload/".$phparray[0]->filename))
+                    if (!is_null($phparray) && file_exists("tmp/upload/".$phparray[0]->filename))
                     {
                         // move files from temp to files directory
                         $tmp = "tmp/upload/";
save-fileupload-patch.patch (919 bytes)   
save-fileupload-v2.patch (943 bytes)   
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\xampp\htdocs\limesurvey
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: save.php
--- save.php Base (BASE)
+++ save.php Locally Modified (Based On LOCAL)
@@ -500,7 +500,7 @@
                     // if the files have not been saved already,
                     // move the files from tmp to the files folder
                     
-                    if (file_exists("tmp/upload/".$phparray[0]->filename))
+                    if (!is_null($phparray) && count($phparray) > 0 && file_exists("tmp/upload/".$phparray[0]->filename))
                     {
                         // move files from temp to files directory
                         $tmp = "tmp/upload/";
save-fileupload-v2.patch (943 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)10280
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql
Server OS (if known)Windows XP
Webserver software & version (if known)Apache 2
PHP Version5

Users monitoring this issue

There are no users monitoring this issue.

Activities

TMSWhite

TMSWhite

2011-06-17 23:12

reporter   ~15482

Use the save-fileupload-v2.patch instead - needed to catch one additional condition to prevent the save.php error

c_schmitz

c_schmitz

2011-06-18 13:31

administrator   ~15491

TMSWhite: looks great, please apply to /limesurvey stable branch.

TMSWhite

TMSWhite

2011-06-18 14:32

reporter   ~15493

OK, committed.

Do you want me to commit the other bug fixes that were assigned to me?

c_schmitz

c_schmitz

2011-06-18 17:12

administrator   ~15494

yes, please

c_schmitz

c_schmitz

2011-06-21 14:31

administrator   ~15542

New version released.

Issue History

Date Modified Username Field Change
2011-06-17 22:05 TMSWhite New Issue
2011-06-17 22:05 TMSWhite File Added: save-fileupload-patch.patch
2011-06-17 23:12 TMSWhite File Added: save-fileupload-v2.patch
2011-06-17 23:12 TMSWhite Note Added: 15482
2011-06-18 13:31 c_schmitz Note Added: 15491
2011-06-18 13:32 c_schmitz Assigned To => TMSWhite
2011-06-18 13:32 c_schmitz Status new => assigned
2011-06-18 14:32 TMSWhite Note Added: 15493
2011-06-18 14:35 TMSWhite Status assigned => resolved
2011-06-18 14:35 TMSWhite Resolution open => fixed
2011-06-18 17:12 c_schmitz Note Added: 15494
2011-06-21 14:31 c_schmitz Note Added: 15542
2011-06-21 14:31 c_schmitz Status resolved => closed