• Resolved Mehul Kaklotar

    (@mehulkaklotar)


    Hello,

    I have a admin only visible fields on form which is only visible in admin backend when editing form. Now on front end when user submit the new form the entry is getting saved and admin is filling those admin only visible fields from backend edit. Now when user is editing form from front end those admin only visible fields getting washed out and admin saved values are getting affected.

    Any help on this will be appreciated.

    https://www.ads-software.com/plugins/gravity-forms-sticky-list/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author fried_eggz

    (@fried_eggz)

    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.

    Thread Starter Mehul Kaklotar

    (@mehulkaklotar)

    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.

    Plugin Author fried_eggz

    (@fried_eggz)

    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.

    Plugin Author fried_eggz

    (@fried_eggz)

    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.

    Thread Starter Mehul Kaklotar

    (@mehulkaklotar)

    Thanks for the update. I’ll update the plugin accordingly.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Admin Only fields getting washed out when editing from front end’ is closed to new replies.