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

Time fields not handled correctly *fix inside* #50

Closed mmarvin1 closed 7 years ago

mmarvin1 commented 8 years ago

Problem occurs when mapping a 12h "time" GF field to a 12h "time" PODS field. You can see the correct time in the GF entry, but the PODS entry will contain the submission timestamp instead of whatever your user input.

The problem is due to the way GF stores Time objects (10:20PM would be ['10','20','pm']). The PODS "time" type cannot handle that type of input, so it gives up and grabs the current timestamp.

I did a quick hack to get it working inside includes\pods_gf.php, in function get_gf_field_value.

On line 2879 of pods_gf.php, add


} elseif ( in_array( $gf_field->type, array( 'time' ) ) ){

$value = $value = $value[0] . ":" . $value[1] . " " . $value[2];

While this fixes it for now, I would love to see this patched so I don't lose it when the plugin updates.

Other than that, great job on the plugin. Makes my job a lot easier.

mmarvin1 commented 8 years ago

This was not fixed in revisions 1.1 or 1.2. If anyone else wants to fix this for themselves, paste my code right after the code that says if ( in_array( $gf_field->type, array( 'name' ) ) ) { $value = implode( ' ', $value );

In version 1.2, this is on line 2956.

sc0ttkclark commented 7 years ago

Sorry for the delay, this has been added to the upcoming 1.3 release.