View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
07013 | Bug reports | Other | public | 2012-12-04 23:21 | 2012-12-11 14:48 |
Reporter | rkabalin | Assigned To | c_schmitz | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.00+ | ||||
Fixed in Version | 2.00+ | ||||
Summary | 07013: kcfinder: image upload problem if survey has not been created yet. | ||||
Description | Basically, if you choose to create a new survey and attempt to upload the image before "saving" it, you will get: mkdir(): Permission denied in /var/www/limesurvey/third_party/kcfinder/core/uploader.php on line 267 the more detailed look reveled that it actually attempt to save the file in: /var/www/limesurvey/third_party/kcfinder/upload/images If I save survey first and then start adding images to text blocks, it works fine, all files are saved where they should be (in upload/surveys/.../) | ||||
Steps To Reproduce |
| ||||
Tags | No tags attached. | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 121117 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | MySQL | ||||
Server OS (if known) | Debian Linux | ||||
Webserver software & version (if known) | Apache, 2.2.16-6+squeeze6 | ||||
PHP Version | 5.3.3-7+squeeze8 | ||||
If I try to upload images here on survey creation I get the message that I don't have permission to do this (which is the intended behaviour) Please update to the latest version and check again. |
|
Intended behaviour? So user should guess that he should save the survey first before he will be able to insert image in the text block? Or more advanced user will start checking permissions of /upload, find that they are correct and will stay puzzled why he can't upload while directory permissions are correct... Will test on latest stable tonight anyway, but doubt it is fixed. The issue is around for a while, I am sure these guys encountered the same case - uploading before saving new survey: |
|
rkabalin: Please try to understand what I wrote before you start ranting. I wrote, that normally you should get a message 'you don't have permission to do this' when trying to upload a file. (and which is currently the expected behaviour) I am completely aware that the message is not optimal. Still, according to your bug report you get a PHP error, which is quite a difference. |
|
c_schmitz: sorry, my mistake, was not that clear in the original description. The message obviously pops-up, it says "Cannot create images folder". The PHP error I mentioned is from apache error log. Updated to latest master (a40d6b1f), the problem with upload persists. |
|
That's really strange because I cannot reproduce it. What browser are you using? |
|
latest Chrome on windows. Also I have debug setting set to 2, that might be why the mkdir is reporting error to log. Quick modification makes it show where it actually tries to write: --- a/third_party/kcfinder/core/uploader.php
and the JS error pop-up becomes " Cannot create /var/www/limesurvey/third_party/kcfinder/upload/images folder" |
|
Can you dump the contents of $_SESSION['KCFINDER'] please? |
|
yep, sure. At the point when there is an error: array(2) { after the survey has been saved (when there is no error): array(5) { |
|
Open application/helper/htmleditor_helper.php and after line
insert this line save, then try again and see if anything changed. |
|
With a fix above it works fine now. Thanks a lot! The potential problem that may araise from here - what will happen if user uploaded the image, but changed his mind and decided not to save survey. What will happen with the file, will it be deleted from /upload directory at some point? |
|
Wait, with that fix applied you should get now the message 'You don't have permission to do this'. |
|
please ignore the previous post, it was a red herring )) I must have created survey when posted the session dump, then deleted it, and then created a new one, which allowed me to save since the directory with the same id for some reason remained there (potentially a different bug). No, the $_SESSION['KCFINDER']['disabled'] = true; fix does not do anything for the new survey. I still get the same "Cannot create images folder" message. |
|
Is there a way I can get access to that system? If yes, please send it (email address removed) |
|
no, sorry, it is my local dev environment. The bug is on the latest master and there is nothing specific about the system, just a minimal apache/php/mysql with no weird settings, or unusual modules. I can's see why you are not able to replicate it. |
|
I am sorry but I can fix only something that I can reproduce. I am sorry but since I cannot reproduce I will need to close the issue. If you find a fix or have new hints regarding the issue feel free to re-open it. |
|
The thing is that we focused on the error message issue here, rather than responding to the original problem defined in the subject. That might be a part of the problem since I reported that php error, but more like a separate bug rather than the original issue. Even with correct message the bug is still there. The message "You don\'t have permissions to upload files" is clearly misleading. If there is no way to upload image before storing survey, it should explicitly say so. Since the discussion of this one was focused on the message content, I suggest to rename it to "incorrect message on file upload attempt at the newly created survey" and fill in another report claiming that "You don't have permissions to upload files" message is misleading as there is nothing wrong with permissions really. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10807 |
|
Fix committed to 2.1 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10822 |
|
Thanks, c_schmitz. There is a typo I commented on in github. |
|
Fix committed to 2.1 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10823 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10824 |
|
2.00 Build 121211 released |
|
LimeSurvey: master f990a8f1 2012-12-09 19:48 Details Diff |
Fixed issue 07013: Misleading error message on file upload if survey has not been saved yet |
Affected Issues 07013 |
|
mod - application/controllers/admin/surveyadmin.php | Diff File | ||
mod - application/helpers/admin/htmleditor_helper.php | Diff File | ||
add - application/views/admin/survey/newSurveyBrowserMessage.php | Diff File | ||
LimeSurvey: 2.1 bc7aeae1 2012-12-09 19:48 Details Diff |
Fixed issue 07013: Misleading error message on file upload if survey has not been saved yet |
Affected Issues 07013 |
|
mod - application/controllers/admin/surveyadmin.php | Diff File | ||
mod - application/helpers/admin/htmleditor_helper.php | Diff File | ||
add - application/views/admin/survey/newSurveyBrowserMessage.php | Diff File | ||
LimeSurvey: 2.1 a2fe9eeb 2012-12-09 22:09 Details Diff |
Fixed issue 07013: Misleading error message on file upload if survey has not been saved yet Dev Typo |
Affected Issues 07013 |
|
mod - application/views/admin/survey/newSurveyBrowserMessage.php | Diff File | ||
LimeSurvey: master fd85b464 2012-12-09 22:09 Details Diff |
Fixed issue 07013: Misleading error message on file upload if survey has not been saved yet Dev Typo |
Affected Issues 07013 |
|
mod - application/views/admin/survey/newSurveyBrowserMessage.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-12-04 23:21 | rkabalin | New Issue | |
2012-12-05 10:41 | c_schmitz | Assigned To | => c_schmitz |
2012-12-05 10:41 | c_schmitz | Status | new => assigned |
2012-12-05 15:12 | c_schmitz | Note Added: 22912 | |
2012-12-05 15:12 | c_schmitz | Status | assigned => feedback |
2012-12-05 15:21 | c_schmitz | Note Edited: 22912 | |
2012-12-05 15:31 | rkabalin | Note Added: 22915 | |
2012-12-05 15:31 | rkabalin | Status | feedback => assigned |
2012-12-05 15:32 | rkabalin | Note Edited: 22915 | |
2012-12-05 19:27 | c_schmitz | Note Added: 22919 | |
2012-12-05 19:27 | c_schmitz | Status | assigned => feedback |
2012-12-05 20:47 | rkabalin | Note Added: 22922 | |
2012-12-05 20:47 | rkabalin | Status | feedback => assigned |
2012-12-05 21:04 | c_schmitz | Note Added: 22924 | |
2012-12-05 21:28 | rkabalin | Note Added: 22925 | |
2012-12-05 22:01 | c_schmitz | Note Added: 22928 | |
2012-12-05 22:10 | rkabalin | Note Added: 22929 | |
2012-12-05 23:17 | c_schmitz | Note Added: 22932 | |
2012-12-05 23:19 | c_schmitz | Note Edited: 22932 | |
2012-12-05 23:32 | c_schmitz | Status | assigned => feedback |
2012-12-05 23:40 | rkabalin | Note Added: 22936 | |
2012-12-05 23:40 | rkabalin | Status | feedback => assigned |
2012-12-06 00:26 | c_schmitz | Note Added: 22941 | |
2012-12-06 00:26 | c_schmitz | Note Edited: 22941 | |
2012-12-06 00:26 | c_schmitz | Status | assigned => feedback |
2012-12-06 00:50 | rkabalin | Note Added: 22943 | |
2012-12-06 00:50 | rkabalin | Status | feedback => assigned |
2012-12-06 11:18 | c_schmitz | Note Added: 22975 | |
2012-12-06 11:19 | c_schmitz | Status | assigned => feedback |
2012-12-06 11:30 | rkabalin | Note Added: 22976 | |
2012-12-06 11:30 | rkabalin | Status | feedback => assigned |
2012-12-06 11:33 | rkabalin | Note Edited: 22976 | |
2012-12-06 11:41 | c_schmitz | Note Added: 22977 | |
2012-12-06 11:41 | c_schmitz | Status | assigned => closed |
2012-12-06 11:41 | c_schmitz | Resolution | open => unable to reproduce |
2012-12-06 12:06 | rkabalin | Note Added: 22978 | |
2012-12-06 12:06 | rkabalin | Status | closed => feedback |
2012-12-06 12:06 | rkabalin | Resolution | unable to reproduce => reopened |
2012-12-09 19:48 | c_schmitz | Changeset attached | => LimeSurvey master f990a8f1 |
2012-12-09 19:48 | c_schmitz | Note Added: 23053 | |
2012-12-09 19:49 | c_schmitz | Status | feedback => resolved |
2012-12-09 19:49 | c_schmitz | Fixed in Version | => 2.00+ |
2012-12-09 19:49 | c_schmitz | Resolution | reopened => fixed |
2012-12-09 20:20 | c_schmitz | Changeset attached | => LimeSurvey 2.1 bc7aeae1 |
2012-12-09 20:20 | c_schmitz | Note Added: 23064 | |
2012-12-09 20:54 | rkabalin | Note Added: 23065 | |
2012-12-09 22:10 | c_schmitz | Changeset attached | => LimeSurvey 2.1 a2fe9eeb |
2012-12-09 22:10 | c_schmitz | Note Added: 23066 | |
2012-12-09 22:11 | c_schmitz | Changeset attached | => LimeSurvey master fd85b464 |
2012-12-09 22:11 | c_schmitz | Note Added: 23067 | |
2012-12-11 14:48 | c_schmitz | Note Added: 23129 | |
2012-12-11 14:48 | c_schmitz | Status | resolved => closed |