Closed (fixed)
Project:
Webform
Version:
6.x-2.1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jul 2008 at 20:49 UTC
Updated:
31 Jul 2008 at 04:47 UTC
Jump to comment: Most recent file
After adding an image to the webform I get an invalid argument error. The webform works correctly if a file is not attached.
I have tried submitting several different file types and from different locations and have received he same error.
I am running Drupal 6.2 on MAMP.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Clipboard02.jpg | 12.33 KB | mrjavum |
| #2 | Picture 1.png | 67.03 KB | easp |
| Picture 1.png | 30.84 KB | easp |
Comments
Comment #1
quicksketchI'm not experiencing this same issue. Some more information might be necessary. The following things might be help:
- Is this a multipage form
- Does the file upload anyway
- Does this only happen when the validation would fail, or on every file
- Could you screenshot your file component configuration
Apologies for the DMV list, I just can't reproduce it on my install.
Comment #2
easp commentedThis is a simple one page form. I am doing some testing and I added a date, email, and file upload field. The form gets submitted correctly, but the file does not upload. Even the smallest 4k file gives the error.
I can upload files correctly if they are attached to pages using the upload module.
The problem appears to be happening on every file. Files that should validate correctly also post the error. Files that I try to upload that are too large or are the wrong format do not validate and shows the correct error message.
I attached a screenshot of my file component config file.
I have disabled all modules except for the core modules that were enabled upon Drupal installation.
Comment #3
mrjavum commentedI have the same error.
I add string to common.inc before line 796
if (!is_array($args)) return $string . (is_string($args)? ' Args: ' . $args: '');And get error (see attached screenshot), but the directory exists in real and has all permissions.
Comment #4
quicksketchI committed two fixes which I think will solve this problem. First, there was a problem with the error message when the file directory didn't exist or was not writable. Second, I made Webform attempt to create the files directory in a more reliable manner. If you can either try out the dev version to confirm the fix, or try using this patch, we can see if this has fixed the problem.
D5: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/webform/com...
D6: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/webform/com...
Comment #5
mrjavum commentedThe changes in patch helps me to fix this problem.
The string
$upload_dir = variable_get('file_directory_path', 'files') ."/webform/". $component['extra']['savelocation'];mast be
$upload_dir = variable_get('file_directory_path', conf_path() .'/files') ."/webform/". $component['extra']['savelocation'];Now it works!
Comment #6
quicksketchThanks mrjavum, I missed that one and corrected that line also. Strangely it was already fixed in Drupal 5, but needed correcting in D6.
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/webform/compo...
Comment #7
quicksketchComment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.