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

Author Field Not Filling In #61

Closed kbrennan981 closed 7 years ago

kbrennan981 commented 7 years ago

I'm currently using the gravity forms pods integration to allow members to create posts easily. However, no matter what I do, I can't seem to get the author feed to work.

I first tried using the supplied method... I know that you can select the check box under DEFAULT POST AUTHOR, that says USE LOGGED IN USER AS AUTHOR, however, even when that box is checked, it seems to always set the author as whatever author is listed in the drop down menu directly above that. So for example, using this solution, if I use gravity forms to create a pods custom post, when the 'use logged in user as author' box is checked (screenshot below), the author for the word post in the example below would end up being 'admin' because that's whats in the drop down. If I change the drop down to something else, then the author would be that name instead (even if the box is checked). image

Next... I also tried to manually set the author by creating a hidden field that I preset the default value as the logged in user, and then in the pods feed, set that field to fill in the author spot. When I try going this route, the correct information comes over in the gravity form as well as the email confirmation sent from gravity forms. I am able to see the correct user that filled in the form / created the post... however, in wordpress, the author field is blank (see screen shots below). Please note, I tried this numerous ways, setting the default value as: User Display Name, User Email, and User Login. None of them worked.

I also tried changing the Post Status under general setting to see if 'pending review' was causing the issue. Again, nothing I have tried works.

Your help would be appreciated. I currently have it set so that each premium user as a portal area where they can manage their posts, however, they can't see posts that they're not technically the author of, which means I have to go in and manually set the author each time.

For what it's worth, I am able to use this second method to fill in a custom pods field with the logged in user info. Just can't get it to populate in the author field. The author field always shows up blank.

image

image

image

kbrennan981 commented 7 years ago

@sc0ttkclark Do you have any idea on when this might be fixed? I only ask because right now, I have to manually change every post accordingly. We're launching within the next week or two, and it would be GREAT if this was working properly. Otherwise, I may have to come up with a quick solution or not use gravity forms.

lukecav commented 7 years ago

@kbrennan981

Seems like it is using post_author. https://github.com/pods-framework/pods-gravity-forms/blob/master/includes/Pods_GF.php#L1413

https://developer.wordpress.org/reference/functions/wp_insert_post/#parameters

kbrennan981 commented 7 years ago

@lukecav, could you elaborate? I'm not sure what you mean.

To recap, I currently have it set up so that when a member fills out and submits the gravity form, using the gravity forms pod integration / feed, it's supposed to create a new post in the custom post type and set it as pending review, with the author set as the logged in user that filled out the gravity form. However, it's working right now. Whether or not the 'use logged in user as author' box is checked, it always uses the default user in the drop down box.

If I try to work around the check box, and create a direct feed using a hidden field w/ default value of the 'logged in user' and author fields... the author field then shows up blank.

There's something wrong with the feed from gravity forms into the author field or something wrong with the check box Use logged in user as author. All the right information makes it's way into the gravity form (I can see it in the confirmation email and form response) but doesn't make it into the post.

kbrennan981 commented 7 years ago

@sc0ttkclark, do you have any thoughts on this?

lukecav commented 7 years ago

So I just tested on local dev, running the current version of Pods for Gravity Forms, Gravity Forms on WP 4.7.3. Created a simple form, extended Post to be the Pod. Then created the feed on the form. Used a simple text field for the author name, then used a merge tag {user:display_name}. https://www.gravityhelp.com/documentation/article/merge-tags/#user-meta

The post was created, but no author was set to the post. https://cloudup.com/idG_GaAMBUy

kbrennan981 commented 7 years ago

Yes, that seems to be what's happening to me too. I need the logged in user filling out the form to become the author for the post.

sc0ttkclark commented 7 years ago

Sorry, I've been focused on Pods 2.7 stuff this week. Let me shoot back around to this task this weekend.

kbrennan981 commented 7 years ago

Hi @sc0ttkclark, any progress on this? It's been about 2 weeks since you said you'd look at it? It's a real issue. And the more I researched it, it doesn't seem like I'm the only one with this issue. Please let me know if you have any recommendations on what I can do to fix this problem.

sc0ttkclark commented 7 years ago

Thanks for your patience, it took me longer on those tasks than planned and then my daughter caught strep.

I'm looking into this today, since you're very responsive -- I hope you'll be able to help me test proposed fixes, would that be accurate?

kbrennan981 commented 7 years ago

I am available to help test. Just let me know what to do.

Thanks,

Kelly

On Wed, Apr 19, 2017 at 1:40 PM, Scott Kingsley Clark < notifications@github.com> wrote:

Thanks for your patience, it took me longer on those tasks than planned and then my daughter caught strep.

I'm looking into this today, since you're very responsive -- I hope you'll be able to help me test proposed fixes, would that be accurate?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pods-framework/pods-gravity-forms/issues/61#issuecomment-295360922, or mute the thread https://github.com/notifications/unsubscribe-auth/AZlBf2mTbocpbotQkuI2g5z1wTgSsKSUks5rxkcDgaJpZM4Mv2_V .

-- Kelly Brennan

FutureTix, Inc brennan@futuretix.com www.futuretix.com 516-608-0626

sc0ttkclark commented 7 years ago

Sorry for the delay again today, I had to take my youngest daughter to the doctor's office as she was also having signs of Strep.

I've got a fix in place now, please confirm it's working with the latest version here: https://github.com/pods-framework/pods-gravity-forms/archive/master.zip

kbrennan981 commented 7 years ago

I cleared some of my schedule today in case you need help testing. I'd really appreciate if you could take a look at this. I know life gets in the way though. I hope you're daughter feels better soon. Let me know if there is anything I can try to fix it on my own. Thank you, @sc0ttkclark!

sc0ttkclark commented 7 years ago

@kbrennan981 I replied last night that I've got a fix in place, so feel free to test that whenever you can today. I can push an update out to wordpress.org after that.

kbrennan981 commented 7 years ago

Ooops, I'm sorry @sc0ttkclark. I missed that last sentence somehow. I'll test it out this morning and let you know. Thank you so much. I really appreciate you moving this to the front.

sc0ttkclark commented 7 years ago

No worries, I accidentally committed a syntax error anyways so you would have hit that first thing today, I just fixed that.

kbrennan981 commented 7 years ago

@sc0ttkclark, Thank you! Thank you! Thank you! It's working now. Much appreciated. I tested it on several different forms and it all seems to go through correctly now. I sincerely appreciate it!

sc0ttkclark commented 7 years ago

Awesome, I'll get this out in the 1.3 release once I get a few more things done.