Curious: Inconsistent db version in 3.4.1 source
-
I did a diff of 3.4.0 and 3.4.1 source files and saw multiple update_option() calls for the ‘ninja_forms_db_version’ setting. The data is not consistent – it is ‘1.1’, ‘1.2’, ‘1.3’ and ‘1.4’
Here’s the diff:
— 3.4.1/ninja-forms/includes/Updates/CacheCollateActions.php 2019-01-15 11:06:30.877880000 +0000
+++ 3.4.0/ninja-forms/includes/Updates/CacheCollateActions.php 2019-01-15 21:46:16.407426500 +0000
@@ -151,6 +151,8 @@
if ( ! $this->debug ) {
// Ensure that our data tables are updated.
$this->migrate( ‘cache_collate_actions’ );
+ // Set out new db version.
+ update_option( ‘ninja_forms_db_version’, ‘1.2’ );
}
// Get a list of our forms…
$sql = “SELECT ID FROM{$this->db->prefix}nf3_forms
“;
— 3.4.1/ninja-forms/includes/Updates/CacheCollateFields.php 2019-01-15 11:06:30.880880200 +0000
+++ 3.4.0/ninja-forms/includes/Updates/CacheCollateFields.php 2019-01-15 21:46:16.409426600 +0000
@@ -178,6 +178,8 @@
if ( ! $this->debug ) {
// Ensure that our data tables are updated.
$this->migrate( ‘cache_collate_fields’ );
+ // Set out new db version.
+ update_option( ‘ninja_forms_db_version’, ‘1.3’ );
}
// Get a list of our forms…
$sql = “SELECT ID FROM{$this->db->prefix}nf3_forms
“;
— 3.4.1/ninja-forms/includes/Updates/CacheCollateForms.php 2019-01-15 11:06:30.881880300 +0000
+++ 3.4.0/ninja-forms/includes/Updates/CacheCollateForms.php 2019-01-15 21:46:16.410426600 +0000
@@ -125,6 +125,8 @@
if ( ! $this->debug ) {
// Ensure that our data tables are updated.
$this->migrate( ‘cache_collate_forms’ );
+ // Set out new db version.
+ update_option( ‘ninja_forms_db_version’, ‘1.1’ );
}
// Get a list of our forms…
$sql = “SELECT ID FROM{$this->table}
“;
— 3.4.1/ninja-forms/includes/Updates/CacheCollateObjects.php 2019-01-15 11:06:30.882880300 +0000
+++ 3.4.0/ninja-forms/includes/Updates/CacheCollateObjects.php 2019-01-15 21:46:16.411426700 +0000
@@ -132,6 +132,8 @@
if ( ! $this->debug ) {
// Ensure that our data tables are updated.
$this->migrate( ‘cache_collate_objects’ );
+ // Set out new db version.
+ update_option( ‘ninja_forms_db_version’, ‘1.4’ );
}
// Get the number of rows in the objects table.
$sql = “SELECT COUNT(id
) as Total FROM{$this->table}
“;Is this correct? (it probably is because it’s for different objects)
Why is the code only called when not in debug mode?
- The topic ‘Curious: Inconsistent db version in 3.4.1 source’ is closed to new replies.