pods-framework / pods-gravity-forms

Integration with Gravity Forms plugin for WordPress (https://pods.io/gravityforms/)
https://wordpress.org/plugins/pods-gravity-forms/
GNU General Public License v2.0
62 stars 10 forks source link

Uploaded File Using Gravity Form Does Not Attach to Pod Post #85

Closed tokazama2 closed 6 years ago

tokazama2 commented 7 years ago

Using Pods 2.7 rc1, Gravity forms 2.2.5, Pods Gravity Forms Add-on 1.3. I have been working on a gravity form. All fields are mapped and working with Pods, except the file upload. The files upload to my server, but not to the pod. I've been chasing my tail trying to figure this out.

gravityforms-export-2017-09-08.zip Pods Configuration Resources only.txt Pods Configuration with all related taxonomy fields.txt Gravity Forms System Status Report.txt

Additional Information that may, or may not, be helpful: The site is not "live" right now. I have to change my hosts file to work on the site.
I have added the following to my child theme functions.php. I disabled it, and this code doesn't seem to make any difference in my dilemma.


add_filter( 'gform_upload_path_10', 'change_upload_path_10', 10, 2 );
function change_upload_path_10( $path_info, $form_id ) {
   $path_info['path'] = '/home/mysite.com/public_html/resources/_member/';
   $path_info['url'] = 'http://mysite.com/resources/_member/';
   return $path_info;
}
tokazama2 commented 7 years ago

I tried reverting back to Pods 2.6 and that does not solve the problem

sc0ttkclark commented 7 years ago

Try the latest 1.4 I'm working on getting out: https://github.com/pods-framework/pods-gravity-forms/archive/feature/skc-fixes.zip

tokazama2 commented 7 years ago

Unfortunately, after testing a variety of setting combinations, it still does not work. I tested on a very simple pod and form. I have exported those settings. For the Gravity Form .json file I simply renamed it to .zip so it would upload. gravityforms-export-2017-09-14.json.zip Upload Test Pods Export.txt

HBMBR commented 7 years ago

Hi i seem to be facing this problem, the issue is also extending to Multi-select as well.

tokazama2 commented 7 years ago

@sc0ttkclark Any luck on figuring this one out? I would be happy to pay for this to be fixed. :-)

sc0ttkclark commented 7 years ago

I should have some more time this weekend, will take another crack at it. Feel free to donate to https://pods.io/friends-of-pods/ anyways :)

tokazama2 commented 7 years ago

@sc0ttkclark Done. Thanks!

sc0ttkclark commented 7 years ago

Still looking into this for you @tokazama2

jimtrue commented 7 years ago

@tokazama2 I checked the 2nd upload you provided and form and had no issues. I thought there might be a problem because the File Upload style was a PLUpload. Since the Processor settings don't come across on the JSON from Gravity Forms, I'm wondering if maybe that's where you're running into the problems.

I could not get your initial configuration and form to work properly. It never passed the document title over and while it uploaded the file, it didn't get transferred into that field. Can you provide a screenshot of your Pod Processor Settings for both forms? That will help us map your fields, properly.

@HBMBR Can you open a separate issue on the Multi-Select? We try to keep the issues if possible related to one issue and not spread them across to multiple areas.

tokazama2 commented 6 years ago

Sorry for the delay. I was side-tracked by a different project. I created a new very simple pod with only one field (file upload) and a simple form (document title, file upload). Please see attached applicable documents.

Pods Configuration Export Results.txt gravityforms-export-2017-11-21.zip Gravity Forms System Status Report.txt upload-test-feed-settings

sc0ttkclark commented 6 years ago

Please try the latest 1.4 beta release: https://github.com/pods-framework/pods-gravity-forms/archive/feature/skc-fixes.zip

tokazama2 commented 6 years ago

I have finally been able to get back to this project. I am currently using pods v2.7.9. The file is now uploading to the default upload folder (renamed to 'resources') and connecting to the custom post type. I just wish I could upload to a certain directory. I suspect that is a WordPress problem and not a Pods problem.

I am using Gravity Forms with Pods. I added the following code to the functions.php file: add_filter( 'gform_upload_path_10', 'change_upload_path_10', 10, 2 ); function change_upload_path_10( $path_info, $form_id ) { $path_info['path'] = '/home/mysite.com/public_html/resources/_member/'; $path_info['url'] = 'http://mysite.com/resources/_member/'; return $path_info; }

Now the file uploads twice, once to the directory as specified in the code listed above and another copy into the main uploads folder.

At least Pods is working. Thanks for your help!

sc0ttkclark commented 6 years ago

Pods GF takes the media from Gravity Forms and adds it to the Media Library. This is likely why you see two. We don't have Pods-specific code for the upload handling, but there are hooks in WordPress itself that you might be able to find to accomplish the same thing.