Quantcast
Viewing all articles
Browse latest Browse all 37

New Gravity Form at the same ID

I’m doing a lot of work on the Parallel Practice site. We made some really significant changes to the form. Naturally, I did that on my development site. I had a vague premonition about getting those changes over to production but figured there’d be some way.1

Many things I did rely on the Gravity Form ID being 1. It impacts how I name certain CSS classes. It determines how I target fields via javascript, and how things get processed in PHP. I could definitely search and replace it throughout my code but I felt like that was begging for lots of minor issues that would be a real hassle to figure out. I could also hand change the form on the production site. That also felt like a real pain with plenty of opportunities to mess up stuff.

After looking around a bit and not finding any good advice, I decided I’d just try editing the database directly.

There are two tables to look at wp_gf_form and wp_gf_form_meta. You may have a prefix other than wp if you set up something custom.

wp_gf_form just has the basic title and ID. I didn’t need to change anything here but it’s nice to take a look at the data.

Now I open my production database and development database so I can compare things. wp_gf_form_meta has three pieces that need to be changed so that the contents match the fields on my development database. The three fields are display_meta, confirmations, and notifications. I copied and pasted from my development database into these fields and saved them.

That worked.

If you’re going to do it, I recommend saving the original production field data some place just in case. You can always put it back if somehow everything breaks.


Viewing all articles
Browse latest Browse all 37

Trending Articles