Hello and thank you for posting this issue. You are absolutely right that this is not the desired behavior.
I have fixed this issue and uploaded a new version (1.2.12). Edited entries now retain admin only field values when edited on the front end.
Please try the new version and post back here.
Hello,
I would like to make a point here. When editing the entry you are calling your post_edit_entry function on gform_post_submission hook. Now this hook is called when all the gravity forms processes finish executing like notifications and all. So the notifications and other stuffs have new entry data and “ENTRY ID” as well. So notifications will carry a new entry ID everywhere. I would like you to remove that hook from end of editing process of gravity form and instead we can just make use of gravity forms code like this:
add_filter( 'gform_entry_id_pre_save_lead', function( $entry, $form ){
if(isset($_POST["action"]) && $_POST["action"] == "edit") {
$original_entry_id = $_POST["edit_id"];
return $original_entry_id;
}
});
This will eliminate post_edit_entry function and gravity form will automatically save the lead using the entry ID.
But now gravity form is overriding those admin only fields don’t know how. If you can understand what I am trying to convey here.
Thank you for taking the time to investigate. I’m however not really sure what the issue is. Could you describe a use case where the current implementation fails?
Also, you are more than welcome to submit a pull request to the github repo.
Thanks for the pull request. For various reasons I’ve decided to solve the problem another way. Anyway, Admin fields are not getting washed out anymore and confirmations and notifications new send the correct ID.
Thanks for the update. I’ll update the plugin accordingly.