1
votes

Context

We've created (I actually inherited code) few forms with Gravity forms. One of the form is used to manage profil informations.

Description

The form doesn't update entries but instead creates new entries. Therefore the result is that in the profil page we have the initial information if we modify and save, after reload nothing changes. But, in the database, a new entry is created.

Tried solution

Setting a field to be unique doesn't fix it but returns an error saying that the value used in the field has already been used.

1

1 Answers

0
votes

Try updating the entry ID before the entry is saved. This example from the gform_entry_id_pre_save_lead documentation will help:

add_filter( 'gform_entry_id_pre_save_lead', 'my_update_entry_on_form_submission', 10, 2 );
function my_update_entry_on_form_submission( $entry_id, $form ) {
    $update_entry_id = rgpost( 'my_update_entry_id' );
    return $update_entry_id ? $update_entry_id : $entry_id;
}