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

Post Title Field Doesn't Update and Post Status stays as Draft regardless of Pods Settings #36

Closed korgonthurus closed 8 years ago

korgonthurus commented 8 years ago

The Gravity Forms' "Post Title" field won't work with PODS & GF plugin. It is unable to pass any values (tested the Title & Status, which I find the most important, but I'm guessing it doesn't work with any values whatsoever).

I managed to use the Gravity Forms + Custom Post Types (https://wordpress.org/plugins/gravity-forms-custom-post-types/) plugin, which successfully updates the Post Status & Title values, BUT conflicts when used with GF & PODS plugin. (If a PODS feed is configured inside the form, the GF + CPT plugin will stop working on the Title & Status values).

jimtrue commented 8 years ago

@korgonthurus Did you set the post title to map into the WP Object field post title in your Pods Processor tab? Yes, I would not recommend doing both plugins as they have conflicting purposes.

So without it installed or activated, and clearing cache, you can't get Post Title or the Status to save as anything other than Draft?

korgonthurus commented 8 years ago

@jimtrue Exactly!

If I map the Post Title field in the appropriate Post Title field in the PODS feed, I'm unable to change the post status. It always stays as draft.

The problem goes deeper, since I've tried many different methods to make this work. It is crucial for pods to "fetch" the post status from the Post Title GF field, because it's the only way any related code would work.

For example I have tried making a function as instructed in the GF documentation, which will enable me to set the post status from a separate field, but this is not doable, since it only works if post fields are used in the form. (also tried to "use" one inside just for testing, and was still unable to make it work). (http://gravitywiz.com/set-post-status-by-field-value/)

Also, I don't know if this should be listed as a separate issue, here is another bug:

I'm unable to get the custom taxonomy's values by using the pods feed.

It does work with simple relationship and advanced relationship fields, correctly getting all the values, but not for taxonomies. This happens in the dropdown field, where we can either add our own options to the selections, or fetch them through the associated pod feed.

The taxonomy is correctly mapped in the feed, but I get the default choices of gravity forms, instead of the available terms of the custom taxonomy (whereas when using relationship fields I'm able to get all the correct values).

DrSammyLee commented 8 years ago

@korgonthurus Using the GF Post Title field in combination with Pods to create posts does NOT work correctly. Rather than using a GF Post Title field, use a GF Single Line Text field and map that to WP Object field post title in Pods processor tab.

I can't remember where I read it, either in the Pods documentation or forum, but it's best to avoid using any of the GF Post fields. Use standard fields mapped to post fields in the Pods processor tab, otherwise you end up with two incomplete posts, one under Posts and the other under your CPT.

korgonthurus commented 8 years ago

@DrSammyLee I totally agree, and this is what I do :) I dont use any GF post fields, Im setting up all the fields I need, then use the pods feed to map them. Everything works great, I create dynamic titles, and auto-complete fields. The problem is a) there is not even a single way at the moment, that you are able to pass "post_status" information to the pods cpt. That means all the submissions go to draft mode, and there's no way to make them auto-publish.

And b) there is this taxonomy issue, where you are unable to set a custom taxonomy pods feed to work correctly, and actually feed the taxonomy list to the field. It will map, if you put a correct value, it will map to the cpt. But this means either setting up manually taxonomies with hundreds of terms, or using the GF + CPT plugin, which will feed the terms correctly.

jimtrue commented 8 years ago

@korgonthorus Did you create a separate issue for the taxonomy? So these can each be patched properly, it really must be one issue per problem

korgonthurus commented 8 years ago

@jimtrue That is true, I am sorry, will do that now!

korgonthurus commented 8 years ago

On further notes, if more people are facing the same problem, you can still choose the default post status from the PODS' advanced options. It's "hardcoded" though, you can't actually change it through GF, but I guess will fit most cases!

jimtrue commented 8 years ago

Well, since the Post Creation is handled by Pods, there's no reason the default post status from the Pods configuration isn't being used for Pods post creation.

jimtrue commented 8 years ago

Okay on a fresh install of the Gravity Forms plugin, I tested Post Title using both a standard text field and mapping it to the Post Title field and also using a Post Object Post Title field. Both worked flawlessly.

On the Draft/Published status: I created a new pod with Post Status of 'Published' in Advanced Options. My entries from the GF feed always go to published, no 'drafts', so not sure if this got fixed in one of the other patches this week or not. @korgonthurus can you verify on your end?

korgonthurus commented 8 years ago

@jimtrue Exactly! That's why I've written the last message, to clarify that the post status inside the PODS's options is working as expected. Post titles as well work flawlessly.

I have done a lot of testing between GF & Pods, and really the only issues was this, and the other taxonomy one.

The case here is that there is no way to actually change the post status through a form. It's a minor issue of course, there's limited use cases where that would be a problem (and I actually tried sorting that through extra functions, as instructed in the linked guide).

I believe this best classifies as a minor bug, and not something that requires attention in the near future.

jimtrue commented 8 years ago

So the real issue is that you can't set Post Status from within the GF field and have it be recognized and passed to Pods, right?

korgonthurus commented 8 years ago

@jimtrue Exactly! Tried numerous ways but wasn't able to do it.

sc0ttkclark commented 8 years ago

Fixed as of the changes tonight :)