From a8d599eae55ad792d8fa2efaee177e4afa8d2e12 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 29 Nov 2012 00:37:30 +0000 Subject: [PATCH] Fix disabling of the link manager on upgrade from 3.4.2 when there are no links. In the 3.4 branch we bumped the DB version past the version used for disabling links in trunk, preventing it from running. In the future, we must avoid increasing branch DB version bumps to HEAD. props SergeyBiryukov. fixes #22626. git-svn-id: http://core.svn.wordpress.org/trunk@22911 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 0e0e36190b..c192cf3aae 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1189,7 +1189,7 @@ function upgrade_340() { function upgrade_350() { global $wp_current_db_version, $wpdb; - if ( $wp_current_db_version < 21501 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) + if ( $wp_current_db_version < 22006 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options() if ( $wp_current_db_version < 21811 && is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { @@ -1948,7 +1948,7 @@ function maybe_disable_automattic_widgets() { function maybe_disable_link_manager() { global $wp_current_db_version, $wpdb; - if ( $wp_current_db_version >= 21501 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) + if ( $wp_current_db_version >= 22006 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) update_option( 'link_manager_enabled', 0 ); }