Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/30/2015 04:48:31 PM (11 years ago)
Author:
johnjamesjacoby
Message:

In bbp_version_updater() only run update routines if a previous installation exists to update. Fixes #2748.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/update.php

    r5466 r5607  
    245245    $raw_db_version = (int) bbp_get_db_version_raw();
    246246
    247     /** 2.0 Branch ************************************************************/
    248 
    249     // 2.0, 2.0.1, 2.0.2, 2.0.3
    250     if ( $raw_db_version < 200 ) {
    251         // No changes
    252     }
    253 
    254     /** 2.1 Branch ************************************************************/
    255 
    256     // 2.1, 2.1.1
    257     if ( $raw_db_version < 211 ) {
    258 
    259         /**
    260          * Repair private and hidden forum data
    261          *
    262          * @link http://bbpress.trac.wordpress.org/ticket/1891
    263          */
    264         bbp_admin_repair_forum_visibility();
    265     }
    266 
    267     /** 2.2 Branch ************************************************************/
    268 
    269     // 2.2
    270     if ( $raw_db_version < 220 ) {
    271 
    272         // Remove any old bbPress roles
    273         bbp_remove_roles();
    274 
    275         // Remove capabilities
    276         bbp_remove_caps();
    277     }
    278 
    279     /** 2.3 Branch ************************************************************/
    280 
    281     // 2.3
    282     if ( $raw_db_version < 230 ) {
    283         // No changes
     247    // Only run updater if previous installation exists
     248    if ( ! empty( $raw_db_version ) ) {
     249
     250        /** 2.0 Branch ********************************************************/
     251
     252        // 2.0, 2.0.1, 2.0.2, 2.0.3
     253        if ( $raw_db_version < 200 ) {
     254            // No changes
     255        }
     256
     257        /** 2.1 Branch ********************************************************/
     258
     259        // 2.1, 2.1.1
     260        if ( $raw_db_version < 211 ) {
     261
     262            /**
     263             * Repair private and hidden forum data
     264             *
     265             * @link http://bbpress.trac.wordpress.org/ticket/1891
     266             */
     267            bbp_admin_repair_forum_visibility();
     268        }
     269
     270        /** 2.2 Branch ********************************************************/
     271
     272        // 2.2
     273        if ( $raw_db_version < 220 ) {
     274
     275            // Remove any old bbPress roles
     276            bbp_remove_roles();
     277
     278            // Remove capabilities
     279            bbp_remove_caps();
     280        }
     281
     282        /** 2.3 Branch ********************************************************/
     283
     284        // 2.3
     285        if ( $raw_db_version < 230 ) {
     286            // No changes
     287        }
    284288    }
    285289
Note: See TracChangeset for help on using the changeset viewer.