Announcement

Collapse
No announcement yet.

Error related to old gravity forms leads table.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error related to old gravity forms leads table.

    We are seeing the following error when submitting a donation

    Click image for larger version  Name:	image (1).png Views:	0 Size:	34.6 KB ID:	49034

    We tracked this down to the following function in the latest version of the plugin.

    /wp-content/plugins/gravity-forms-click-pledge/class.GFCnpPlugin.php

    Code:
      /**
      * check whether this form entry's unique ID has already been used; if so, we've already done a payment attempt.
      * @param array $form
      * @return boolean
      */
      protected function hasFormBeenProcessed($form) {
        global $wpdb;
        $unique_id = RGFormsModel::get_form_unique_id($form['id']);
        $sql = "select lead_id from {$wpdb->prefix}rg_lead_meta where meta_key='gfcnp_unique_id' and meta_value = \"%s\"";
        $lead_id = $wpdb->get_var($wpdb->prepare($sql, $unique_id));
        return !empty($lead_id);
      }
    From what I can see this table 'wp_rg_lead_meta' was deprecated since gravity forms 2.3. See https://docs.gravityforms.com/databa...rence/#changes

    Although the plugin says it supports the following version.

    Any assistance would be appreciated!
    Last edited by aneumann-cafb; 09-13-2019, 03:36 PM.

  • #2
    I think the following should work in both legacy and current gravity forms.

    Code:
    /**
      * check whether this form entry's unique ID has already been used; if so, we've already done a payment attempt.
      * @param array $form
      * @return boolean
      */
      protected function hasFormBeenProcessed($form) {
        global $wpdb;
        $unique_id = RGFormsModel::get_form_unique_id($form['id']);
        $entry_table_name = version_compare( GFFormsModel::get_database_version(), '2.3-dev-1', '<' ) ? GFFormsModel::get_lead_table_name() : GFFormsModel::get_entry_meta_table_name();
        $sql = "select * from {$entry_table_name} where meta_key='gfcnp_unique_id' and meta_value = \"%s\"";
        $lead = $wpdb->get_row($wpdb->prepare($sql, $unique_id));
        return !empty($lead);
      }

    Comment


    • #3
      Good day @aneumann-cafb

      Sorry for the inconvenience and thank you for notifying us. We reviewed and identified the issue. We are working on it and will release the patch by tomorrow or day after. We will keep you update.

      Regards,
      Click & Pledge Support Department

      On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

      Join us @ the educational webinars: https://clickandpledge.com/webinars/
      Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
      Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

      Comment


      • #4
        Good day @aneumann-cafb

        We have released the compatible version of Gravity Forms today: https://forums.clickandpledge.com/fo...te-and-bug-fix

        Please update and let us know if you find any issues.
        Regards,
        Click & Pledge Support Department

        On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

        Join us @ the educational webinars: https://clickandpledge.com/webinars/
        Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
        Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

        Comment

        Working...
        X