View Issue Details

IDProjectCategoryView StatusLast Update
04956Bug reports[All Projects] Survey takingpublic2011-05-04 19:51
Reportertpartner 
Assigned Totexens 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91RC3 
Target Version1.91RC4Fixed in Version1.91 
Summary04956: Problems with the file upload user interface
Description1) Cannot delete uploaded file - after uploading a file, then trying to delete it, I get an error "Warning: fopen(tmp/upload/) [function.fopen]: failed to open stream: No such file or directory in C:\xampp\htdocs\limeSurveyTest\delete.php on line 55"

2) After uploading a file, moving on to another group and then returning to the file-upload group, the table displaying the file details does not appear. It only re-appears after opening the modaldialog again.

3) There are some alerts that I'm not sure should appear - in modaldialog.js, lines 93, 107, 111
TagsNo tags attached.
Complete LimeSurvey version number (& build)9786
I will donate to the project if issue is resolvedNo
BrowserFireFox
Database & DB-VersionmySQL - 5.1.41
Operating System (Server)Win 7
Webserver software & versionApache - 2.2.14
PHP VersionPHP - 5.3.1

Relationships

Activities

tpartner

2011-02-15 16:44

developer   ~14184

Hi texens,

I thought it would be easier to group these together but I can move them into separate bugs if you like.

Let me know if you need more details.

texens

2011-02-16 14:28

reporter   ~14201

I also ran into issue #1, didn't try issue #2 and #3 yet. Its easier to have them all at one place :) If I need any more details, I'll let you know.

Thanks for testing :) There was a major code overhaul last week to overcome a design issue (that resulted in failure when we have more than one question on the same page) and a couple things are broken right now :|

c_schmitz

2011-03-08 14:57

administrator   ~14337

What's the status on this? Didn't you resolve it already? If yes, please set to resolved.

bquiller

2011-03-23 11:16

reporter   ~14523

I don't know if it corresponds on what you wanted to do but I really need the file upload so I have done the following modification

In uploader.js
replace onclick='deletefile("+count+")' by onclick=\"deletefile('"+ia+"',"+i+")\"

In modalDialog.js
put display += '</tr></table>'; outside the for to correct the table display
replace var pass = document.getElementById('uploader').contentDocument.defaultView.saveAndExit(fieldname, show_title, show_comment, pos);
By var pass = window.frames.uploader.saveAndExit(fieldname, show_title, show_comment, pos);
to saveAndExit in IE.

Think it works ...

texens

2011-04-12 14:32

reporter   ~14798

Issues 1 and 3 mentioned above in the description - fixed in r9979.
Issue 2 still needs to be resolved.

magiclko

2011-04-22 17:27

reporter  

04956_stable_mod.diff (1,440 bytes)
Index: qanda.php
===================================================================
--- qanda.php	(revision 10017)
+++ qanda.php	(working copy)
@@ -3849,6 +3849,18 @@
                     });
                 </script>';
 
+	$answer .= '<script type="text/javascript">
+                    $(document).ready(function(){
+ 						var fieldname = "'.$ia[1].'";
+			 			var filecount = $("#"+fieldname+"_filecount").val();
+ 						var json = $("#"+fieldname).val();
+						var show_title = "'.$qidattributes["show_title"].'";
+						var show_comment = "'.$qidattributes["show_comment"].'";
+						var pos = "'.($pos?1:0).'";
+						displayUploadedFiles(json, filecount, fieldname, show_title, show_comment, pos);
+    				});
+  	          </script>';
+
     $inputnames[] = $ia[1];
     $inputnames[] = $ia[1]."_filecount";
     return array($answer, $inputnames);
Index: scripts/modaldialog.js
===================================================================
--- scripts/modaldialog.js	(revision 10017)
+++ scripts/modaldialog.js	(working copy)
@@ -121,7 +121,13 @@
     var jsonobj;
     var i;
 
-    if (jsonstring !== '')
+    if (jsonstring == '[]') {
+    	var display ='';
+    	$('#'+fieldname+'_uploadedfiles').html(display);
+		return;
+    }
+
+	if (jsonstring !== '')
     {
         jsonobj = eval('(' + jsonstring + ')');
         var display = '<table width="100%"><tr><th align="center" width="20%">&nbsp;</th>';
04956_stable_mod.diff (1,440 bytes)

magiclko

2011-04-22 17:35

reporter   ~14856

Hi texens,

I have uploaded a diff file to correct two issues :

1. issue #2 already mentioned!
2. a small issue that when just opening and closing dialog box result in empty table(title,comment,name etc).

If anybody can review the file, it would be great :-)

P.S. @texens, shouldn't variables pos, show_title, show_comment, maxfiles, filecount and many other be integers(they are string currently, i guess).

texens

2011-05-01 17:58

reporter   ~14897

Issue fixed in r10028.
Thank you magiclko for the patch

Issue History

Date Modified Username Field Change
2011-02-15 16:41 tpartner New Issue
2011-02-15 16:42 tpartner Assigned To => texens
2011-02-15 16:42 tpartner Status new => assigned
2011-02-15 16:44 tpartner Note Added: 14184
2011-02-16 14:28 texens Note Added: 14201
2011-03-08 14:57 c_schmitz Note Added: 14337
2011-03-23 11:16 bquiller Note Added: 14523
2011-04-12 14:32 texens Note Added: 14798
2011-04-22 17:27 magiclko File Added: 04956_stable_mod.diff
2011-04-22 17:35 magiclko Note Added: 14856
2011-05-01 17:58 texens Note Added: 14897
2011-05-01 17:58 texens Status assigned => resolved
2011-05-01 17:58 texens Resolution open => fixed
2011-05-04 19:51 c_schmitz Status resolved => closed
2011-05-04 19:51 c_schmitz Fixed in Version => 1.91