Skip to content

Commit

Permalink
My Jetpack: fix the 'Missing site connection' notice (#39809)
Browse files Browse the repository at this point in the history
My Jetpack will ask to establish user connection even if site connection is missing.
This PR will give the "missing site connection" notice more priority so it would show up on non-connected sites.
  • Loading branch information
sergeymitr authored and gogdzl committed Oct 25, 2024
1 parent 33a4d42 commit 8fb5511
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix the "Missing site connection" notice.
9 changes: 5 additions & 4 deletions projects/packages/my-jetpack/src/class-initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,17 +940,18 @@ public static function alert_if_missing_connection( array $red_bubble_slugs ) {
$broken_modules = self::check_for_broken_modules();
$connection = new Connection_Manager();

if ( ! empty( $broken_modules['needs_user_connection'] ) ) {
// Checking for site connection issues first.
if ( ! empty( $broken_modules['needs_site_connection'] ) ) {
$red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array(
'type' => 'user',
'type' => 'site',
'is_error' => true,
);
return $red_bubble_slugs;
}

if ( ! empty( $broken_modules['needs_site_connection'] ) ) {
if ( ! empty( $broken_modules['needs_user_connection'] ) ) {
$red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array(
'type' => 'site',
'type' => 'user',
'is_error' => true,
);
return $red_bubble_slugs;
Expand Down

0 comments on commit 8fb5511

Please sign in to comment.