• Fatal error Uncaught Error: Class “RGForms” not found when submitting any form that has a select field with “Try to Set Parent” enabled.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @valerio_cas

    We have fixed this issue in the latest release of the plugin; v3.1.32. Can you please try updating?

    Do let us know if you have any further questions!

    Moderator Dominik Schilling

    (@ocean90)

    WordPress Core Developer

    Hello @saifsultanc, unfortunately the fix isn’t complete because RGForms is still used in GFCPTAddon1_5::get_form_parent_post_id(). A check needs to be performed to see which class exists, and the existing class should be used.

    Patch:

    # Use GFForms when the deprecated RGForms class is unavailable,
    # it was removed in Gravity Forms 3.0.
    # See https://wordpress.org/support/topic/fatal-error-under-gravity-forms-3-0-rgforms-class-removed/
    diff --git a/gfcptaddon_1-5.php b/gfcptaddon_1-5.php
    --- a/gfcptaddon_1-5.php
    +++ b/gfcptaddon_1-5.php
    @@ -67,7 +67,9 @@ class GFCPTAddon1_5 extends GFCPTAddonBase {
    function get_form_parent_post_id( $form ) {
    foreach ( $form['fields'] as $field ) {
    if ( $field['type'] == 'select' && $field['setParentPost'] ) {
    - $parent_id = RGForms::post( 'input_' . $field['id'] );
    + // RGForms was removed in Gravity Forms 3.0.
    + $gf_class = class_exists( 'RGForms' ) ? 'RGForms' : 'GFForms';
    + $parent_id = $gf_class::post( 'input_' . $field['id'] );

    return $parent_id;
    }
Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.