PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Can I change the order that hooks fire? Or is there a list of when hooks fire?

  1. Deepend
    Member

    Hi,

    I am creating dynamic XML data inside gform_postsubmission which i need to call on the confirmation page. For this I have been trying to use gform_confirmation .

    But gform_confirmation fires after postsubmission.... This seems illogical to me, shouldn't confirmation fire after the form is submitted??

    Is there a way to modify this behaviour?

    Or is there a more appropriate set of hooks to use that will fire in order to create dynamic data, the retrieve it and display it in a confirmation page?

    A chronological list of when hooks fire would be very nice.

    Any help would be much appreciated, we have lost days over this now.

    Regards.

    Posted 7 years ago on Thursday November 8, 2012 | Permalink
  2. Deepend
    Member

    Is this going to be another techincal post that doesn't get answered? What are we paying this licence fee for anyway?

    Posted 7 years ago on Thursday November 8, 2012 | Permalink
  3. Deepend
    Member

    The developer documentation is really pretty weak. Seems like GF is a solution for end users moreso than anyone who wants to integrate into complex apps like ecommerce... We have lost so much time now on GF that we could have built these forms from scratch and they would have worked.

    Would GF like to comment? Or perhaps answer some of my questions? Seriously considering abandoning this software alltogether now.

    Posted 7 years ago on Thursday November 8, 2012 | Permalink
  4. Hi Deepend,

    Sorry you're frustrated. Giving us a chance to answer would help us alleviate some of this frustration and save you a little time.

    The "gform_post_submission" hook should be deprecated in favor of the "gform_after_submission" hook. I checked the documentation and see that a notice was never added to this page. I agree that is pretty annoying.

    With that out of the way, what were you doing in the "gform_post_submission" hook that could not be done in the "gform_confirmation" hook? Both hooks are passed the $form and $entry objects. Was there something else you needed data-wise?

    Posted 7 years ago on Thursday November 8, 2012 | Permalink
  5. Deepend
    Member

    So I moved the whole payment gateway into the confirmation hook.. The payment gateway started working! Only problem now is I need to modify a hidden field on the form following a success or fail response from the 3rd party application.

    How can I modify the entry within the confirmation hook?

    I would think that I should be using a hook that fires after confirmation for this, but can't find anything that works and modifies the entry.

    Posted 7 years ago on Wednesday March 6, 2013 | Permalink
  6. To modify an entry after you get your answer from the 3rd party you can use the gform_confirmation and some SQL to update the entry with your 3rd party response.

    [php]
    $wpdb->insert("{$wpdb->prefix}rg_lead_detail", array(
        'value' => $responseCode,
        'field_number' => $field_number,
        'lead_id' => $entry['id'],
        'form_id' => $entry['form_id']
    ));

    gform_confirmation has available the $lead ($entry) and the $form, which should be all you need, other than the field ID and the response code.

    Posted 7 years ago on Sunday March 10, 2013 | Permalink

This topic has been resolved and has been closed to new replies.