csalzano / power-boost-for-gravity-forms

Enhances the dashboard for Gravity Forms power users. Nine features I can't live without.
https://breakfastco.xyz/power-boost-for-gravity-forms/
14 stars 3 forks source link

Updating a GravityForm from JSON doesn't update its GravityFlow feed #22

Open dcoder2099 opened 8 months ago

dcoder2099 commented 8 months ago

We use GravityForms along with GravityFlow to allow our website to interact with several third-party systems.

We are experimenting with PowerBoost's Local JSON and Replace Forms feature to sync configuration between our dev/stage/production environments.

Inspecting the JSON from one of our forms that was saved using the Local JSON feature, there is a top-level "feeds" property where the GravityFlow workflow configuration is serialized (see attached).

However, when trying to move a form from one environment to the next, the replaced a form does not pick up the GravityFlow configuration.

I see in this code, that PowerBoost is delegating the update to GFAPI::update_form().

What I don't know is whether GFPB_Form_Replacer::update_forms() should also be responsible for calling GFAPI:update_feed()?

Or if this may be an issue in GFAPI in that it should detect that the form has a feeds property and attempt to update the feeds as well?

Or it could be that GravityFlow is hooking into GravityForms incorrectly?

Sorry, I'm not an experienced WordPress plugin developer. I'm just trying to figure out a way for us to migrate the workflows between environments and avoid having to manually rebuild them.

Any guidance or recommendations would be appreciated.

Thanks, Daniel.

12.json

csalzano commented 8 months ago

Thanks for trying my plugin. I don't have a copy of Gravity Flow. That's my problem, not yours. I'd look for a Gravity Flow save hook and start reading the nearby code to see how the feeds data is placed.

shreejiravalji commented 1 week ago

Hi @csalzano ,

Thank you for developing this plugin.

The "replace form" feature does not update the workflow steps.

Will there be an update for Gravity Flow soon that addresses this issue?

csalzano commented 1 week ago

By default, feeds aren't exported with forms when the Gravity Forms export tool at Forms > Import / Export > Export Forms is used. Try it. There's an empty "feeds":[] array in the json, but none of form's feeds are in it. Does Gravity Flow override this behavior in the exporter and the importer to migrate feeds with forms?

I don't know. I have yet to work on a site with Gravity Flow, so I don't have a copy of the plugin. Send me a copy of Gravity Flow and I'll take a look. 938411+csalzano@users.noreply.github.com. I negotiated a free copy with Gravity Forms support back in February, but I never made time to do the work after I realized feeds are never in the form .json files. My gravityflow.io account has since been deleted.