Support » Plugin: Gravity Forms Repeater Add-On » [PARTIALLY SOLVED] Gravity Forms 2.4 compatibility

  • philippenantes


    Like you may have noticed, GravityForms 2.4+ includes (beta / hidden) repeater feature. But the class name used in GF is the same GF_Field_Repeater and break this add-on.

    This will cause a “PHP Fatal error: Cannot declare class GF_Field_Repeater, because the name is already in use” error.

    I ended up replacing the class name GF_Field_Repeater with GF_Field_Repeater2 in all occurrences in all files of the plugin.
    And renaming every occurence of “repeater” with “repeater2” and ‘repeater’ with ‘repeater2’ (note the difference between ‘ and “).
    Finally renamed files containing repeater with repeater2 (i.e. class-gf-field-repeater.php becomes class-gf-field-repeater2.php, etc ) and renamed the plugin folder.

    Obviously, this is a in quick and dirty mode, still I edited the plugin;
    but A/it is no longer supported (Big up and many thanks anyway to the author) so no upgrade available = no upgrade overwrites
    B/I guess GF will provide soon a gui for its native repeater.

    I repacked the whole working version, so you can download it here

    This works at least for me. I’ve just tested it very briefly on a basic form, so I dont guarantee blah blah it will work for you Disclaimer blah blah.

Viewing 2 replies - 1 through 2 (of 2 total)
  • ProjectArmy


    Have you tried simply disabling this plugin?

    We noticed that Gravity Forms either re-used the code from this plugin or simply used the same naming conventions in version 2.4 and up. After disabling this addon plugin, the repeater functionality in the frontend continues to work.

    However, backend form editor does not have blocks yet for repeater. So forms that were created this this addon plugin will continue to work in Gravity Forms 2.4+ but you won’t be able to edit them. And you can’t create new forms with repeater blocks.

    This repeater feature is in beta now.

    @supporthero That’s what @philippenantes has looked to resolve without needing to deactivate the plugin and/or switch to a different solution for repeatable fields. The fact that is in beta without an interface for managing this with the form builder and (what’s recommended by the original plugin developer) being a paid add-on has this quick patch to resolve the issue being a worthwhile stopgap for now.

    – My Results –

    I can say this updated plugin by @philippenantes alleviates the 500 server error. I might suggest also updating the 1.0.9 version to instead be as a nod to the fact that it’s a further bugfix for the 1.0.9 version of the abandoned (and now 100% problematic with current versions of Gravity Forms as mentioned) Gravity Forms Repeater Add-on.

    – Important database considerations for existing installations being patched/migrated –

    It appears that you do need to also go in and update the database to use repeater2 instead of repeater for GF form meta & other aspects to get past form setups & submissions to match the newly renamed repeater2 setup when using this patched plugin setup.

    In my case, I needed to do a find & replace so “repeater” is instead “repeater2” in the display_meta for the form(s) with it present within the wp_gf_form_meta database table (replacing wp_ table prefix as needed). I can confirm that I then had my form with a repeater field & repeater end field correctly displayed as such once that search & replace was done (it’s not a serialized database field so it was generally safe to do, but even then it should be done with caution & with a recent backup of the database readily available.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[PARTIALLY SOLVED] Gravity Forms 2.4 compatibility’ is closed to new replies.