Skip to content

Commit

Permalink
Connection: fix the connected plugins option on multisites (#39355)
Browse files Browse the repository at this point in the history
Recent optimizations of the connected plugin options update/sync exposed an issue in the original implementation, making the "active connected plugins" option always empty on multisites.
Here we fix that problem.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10817836631

Upstream-Ref: Automattic/jetpack@11ebad6
  • Loading branch information
sergeymitr authored and matticbot committed Sep 11, 2024
1 parent 13d17e0 commit 6a8fed5
Show file tree
Hide file tree
Showing 19 changed files with 143 additions and 132 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"automattic/jetpack-autoloader": "^3.1.0",
"automattic/jetpack-composer-plugin": "^2.0.3",
"automattic/jetpack-config": "^2.0.4",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-my-jetpack": "^4.35.6-alpha",
"automattic/jetpack-search": "^0.45.4-alpha",
"automattic/jetpack-stats": "^0.13.2",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-boost-core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2"
"automattic/jetpack-connection": "^4.0.3-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.0.3-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Fixed
- Fix the connected plugins option on multisites.

## [4.0.2] - 2024-09-10
### Changed
- Updated package dependencies. [#39302]
Expand Down Expand Up @@ -1191,6 +1198,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[4.0.3-alpha]: https://github.com/Automattic/jetpack-connection/compare/v4.0.2...v4.0.3-alpha
[4.0.2]: https://github.com/Automattic/jetpack-connection/compare/v4.0.1...v4.0.2
[4.0.1]: https://github.com/Automattic/jetpack-connection/compare/v4.0.0...v4.0.1
[4.0.0]: https://github.com/Automattic/jetpack-connection/compare/v3.0.0...v4.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '4.0.2';
const PACKAGE_VERSION = '4.0.3-alpha';

const PACKAGE_SLUG = 'connection';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ private static function ensure_configured() {
}

if ( is_multisite() && get_current_blog_id() !== self::$current_blog_id ) {
self::$plugins = (array) get_option( self::ACTIVE_PLUGINS_OPTION_NAME, array() );
if ( self::$current_blog_id ) {
// If blog ID got changed, pull the list of active plugins for that blog from the database.
self::$plugins = (array) get_option( self::ACTIVE_PLUGINS_OPTION_NAME, array() );
}
self::$current_blog_id = get_current_blog_id();
}

Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-explat/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2"
"automattic/jetpack-connection": "^4.0.3-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-jitm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.0",
"automattic/jetpack-a8c-mc-stats": "^2.0.2",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-device-detection": "^2.1.5-alpha",
"automattic/jetpack-logo": "^2.0.4",
"automattic/jetpack-redirect": "^2.0.4",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-licensing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2"
"automattic/jetpack-connection": "^4.0.3-alpha"
},
"require-dev": {
"automattic/wordbless": "@dev",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"automattic/jetpack-admin-ui": "^0.4.5",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-boost-speed-score": "^0.3.12",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-explat": "^0.1.8",
"automattic/jetpack-jitm": "^3.1.22",
"automattic/jetpack-licensing": "^2.0.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-plugins-installer": "^0.4.3",
"automattic/jetpack-sync": "^3.13.0-alpha",
"automattic/jetpack-protect-models": "^0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-search/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-status": "^4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-stats/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-status": "^4.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-sync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2",
"automattic/jetpack-connection": "^4.0.3-alpha",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-password-checker": "^0.3.2",
"automattic/jetpack-ip": "^0.2.3",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '4.0.2',
'ver' => '4.0.3-alpha1726080715',
),
'jetpack-explat' => array(
'path' => 'jetpack_vendor/automattic/jetpack-explat',
Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-plans/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.2"
"automattic/jetpack-connection": "^4.0.3-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
Loading

0 comments on commit 6a8fed5

Please sign in to comment.