• Resolved daymobrew

    (@daymobrew)


    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Kyle B. Johnson

    (@kbjohnson90)

    The wrapped code allows for “dry runs” of the conversion, which is an optional troubleshooting feature.

    Plugin Author krmoorhouse

    (@krmoorhouse)

    Hey @daymobrew,

    The files you’re referencing are required update files that manage upgrading our database tables. In order to accurately track which of these upgrades have already run, we’re incrementing the version as they’re stepped through in the update process.

    So, this version number is for internal tracking, and it shouldn’t mean anything to anyone outside of our development team at this point in time.

    Hopefully, this answers your question.

    -KR

    Thread Starter daymobrew

    (@daymobrew)

    Yes, question answered. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Curious: Inconsistent db version in 3.4.1 source’ is closed to new replies.