Closed timiwahalahti closed 5 years ago
@k1sul1 you've done this feature, like to check this out?
This situation can happen, when the plugin is updated before the single form is saved. In that case, _wplf_plugin_version
contains the version number of the updated plugin, not the plugin where the form was created. This might cause problems with additional fields and others in the future.
Maybe use upgrader_process_complete hook to save some legacy version number to old forms after the plugin has updated? Tho this won't work if the plugin is updated manually.
Maybe add an admin_init
hook with simple WP_Query
checking the existence of _wplf_plugin_version
meta and adding legacy version to forms without version? It is somewhat expensive, but works and is the most effective way to deal with this problem.
I don't like the upgrader_process_complete hook because it doesn't fire when managing plugins with Composer, or when updating them manually.
If the version indeed updates, even when the checkbox is not checked, that's a bug, I'll check it out. The version is meant to be used if we ever ad a feature that changes how something works, like when we added additional field validation.
Even the
Yes, update when I save the form
checkbox is not checked, meta value_wplf_plugin_version
is saved to contain the version number1.5.0.1
. That meta value should not be saved if the checkbox is not active. It might quite possibly break things.