Skip to content

Commit b7e9bf7

Browse files
authored
gppa-force-repop-on-submit.php: Fixed issue where submitted value was sometimes returned as valid value.
1 parent b6e81c2 commit b7e9bf7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gp-populate-anything/gppa-force-repop-on-submit.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@
3434
}
3535

3636
$working_field_values = $field_values;
37+
38+
// Unset existing values so GPPA doesn't fetch it as a fallback when retrieving the populated value.
3739
unset( $working_field_values[ $field->id ] );
40+
$_POST["input_{$field->id}"] = null;
3841

39-
$populated_field = gp_populate_anything()->populate_field( $field, $form, $working_field_values, null, true );
42+
$populated_field = gp_populate_anything()->populate_field( $field, $form, $working_field_values, null, false );
4043
$correct_value = $populated_field['field_value'];
4144

4245
$working_field_values[ $field->id ] = $correct_value;

0 commit comments

Comments
 (0)