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

Dropdown menu items reset by Pods Gravity Forms #168

Closed adamjrice closed 5 months ago

adamjrice commented 5 months ago

Issue Overview

I have a GF form tied to user profiles extended using Pods. One of the form elements is a dropdown field, which maps to a "relationship >> simple" list in the Pods field.

The Pods field is set up with options A, B, C.

In GF, when editing the choices for the menu, I enabled separate labels and values, and set them up like this:

Apple  | A
Banana | B
Cherry | C

As soon as I save the form, the menu reverts to

A | A
B | B
C | C

I have corresponded with GF support, and they pointed to the Pods-Gravity Forms connection as the culprit.

sc0ttkclark commented 5 months ago

@adamjrice If you set your field to dynamically populate from Pods and you have a Pods feed setup for that form, it will always overwrite the displayed (and ultimately saved) options for that GF field. It populates it based on the settings of your corresponding field.

You don't have to dynamically populate the field for it to map. You can always turn that off (it's off by default) and you can manually enter the values you want to be selected from. The only thing you have to be careful of is to ensure that the "value" of the corresponding label of each option matches the value in the Relationship field so it maps correctly when saving.

adamjrice commented 5 months ago

@sc0ttkclark Thanks. I have "populate related items" unchecked, and "allow fields to be populated dynamically" unchecked, and I'm having this problem anyhow.

sc0ttkclark commented 5 months ago

I'll check this out and see if I can reproduce it.

sc0ttkclark commented 5 months ago

Fixed via https://github.com/pods-framework/pods-gravity-forms/commit/ac3adcd4a7d2bbaceb70c8ee1be2d20ee0dcc41a