| @@ -744,10 +744,14 @@ | ||
| 744 | 744 | if ( ! class_exists( __NAMESPACE__ . '\\Object_Cache' ) ) { |
| 745 | 745 | return $result; |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | - $opts = (array) Settings_Manager::get( 'object-cache' ); | |
| 749 | - $state = Object_Cache::enable( $opts ); | |
| 748 | + $opts = (array) Settings_Manager::get( 'object-cache' ); | |
| 749 | + // An import IS the user switching away from the source plugin, so it | |
| 750 | + // takes the same switch path: the source's own object cache is turned | |
| 751 | + // off through its settings (or the plugin deactivated) before ours goes | |
| 752 | + // in, instead of being overwritten while it stays on. (#686) | |
| 753 | + $state = Object_Cache::enable( $opts, array( 'takeover' => true ) ); | |
| 750 | 754 | |
| 751 | 755 | $result['ok'] = ! empty( $state['ok'] ); |
| 752 | 756 | $result['object_cache_ready'] = ! empty( $state['ok'] ); |
| 753 | 757 | if ( empty( $state['ok'] ) ) { |