Categories
Code Gravity Forms

Is Gravity Forms not able to repair your `gf_addon_feed` database table?

If you click the “Re-run database upgrade” link in Gravity Forms’ System Status page, and it doesn’t properly generate the {prefix}_gf_addon_feed table, here’s the likely problem:

The Feed Addon that you have installed is likely not being activated early enough. This is about to get techy:

The “Re-run database upgrade” script is triggered by the gform_loaded action, which likely has already run by the time plugins_loaded runs. If the add-on hooks into plugins_loaded to initiate, it will have already “missed the boat”.

This means that if a plugin uses plugins_loaded, the gf_addon_feed table is never created because the GFFeedAddon::post_gravityforms_upgrade() method is never called, because the gform_post_upgrade hook has already run by the time plugins_loaded is completed.

If you hook into plugins_loaded with a priority higher than the default of 10, this will fix the problem, because Gravity Forms will know about your add-on before gform_loaded action is run.

By Zack Katz

Zack Katz is the creator of GravityView and the President of Katz Web Services. He lives in Leverett, Massachusetts with his wife and cute beast of a cat.