Posted by Virtualandscape on October 3, 2010 at 6:00pm
8 followers
| Project: | Webform |
| Version: | 7.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
In components/file.inc, line 275, is a call to file_directory_path() , which no longer exists in Drupal 7.
It makes Webform unusable to send attached files.
Comments
#1
Yep, D7 Webform has postponed development until D7 stabilizes.
#2
It's in beta now, should be good to go ahead and fix. Thanks
#3
We were in code freeze a year ago, beta doesn't mean anything other than the upgrade path now works.
#4
This patch replaces file_directory_path with file_build_uri to get a path to the default files folder.
#5
I filed #942974: WSOD on private file downloads as a separate issue, so I don't think webform_file_download() is worth patching here. The only other use of file_directory_path is for the field_prefix on the file component edit form. I changed that so that we're displaying the actual directory the files will go in - I think sites/mysite.com/files/webform/ will make more sense to people than public://webform/.
#6
There is one other mention of file_directory_path in the comment of _webform_recursive_delete, so this patch includes a changed comment in addition to ksenzee's patch in #5.
This is RTBC for the part in #5, so only review needed for the comment.
#7
Thanks ksenzee and Stevel for the patches. I've rerolled it to remove _webform_delete_recursive() entirely, since we can now use file_unmanaged_delete_recursive() provided by core instead. Committed to HEAD.
#8
Sorry - I removed that mention in the comment precisely because I was going to suggest nixing _webform_delete_recursive, then I forgot to say why I did it. Luckily quicksketch is way ahead of me.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.
#10
You Can use this in drupal 7
$files_dir = file_stream_wrapper_get_instance_by_uri('public://')->getDirectoryPath();
instead of
file_directory_path();
#11
To get full path, please use
file_stream_wrapper_get_instance_by_uri('public://')->realpath();