From 7d44f0a036cf5c87846d08dbdd2e5c81ccb2e92e Mon Sep 17 00:00:00 2001 From: daledupreez Date: Thu, 2 Nov 2023 10:49:03 +0000 Subject: [PATCH] Lanchpad: Customization hooks: Make more resilient (#33923) * Lanchpad: Customization hooks: Make more resilient * changelog * Bump version --------- Co-authored-by: Dale du Preez Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/6731261261 --- composer.json | 2 +- composer.lock | 8 ++++---- vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md | 8 ++++++++ .../jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php | 2 +- .../launchpad/launchpad-task-definitions.php | 12 +++++++----- vendor/composer/installed.json | 6 +++--- vendor/composer/installed.php | 6 +++--- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index b0949705..fac17315 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "wordpress-plugin", "license": "GPL-2.0-or-later", "require": { - "automattic/jetpack-mu-wpcom": "^4.16.1" + "automattic/jetpack-mu-wpcom": "^4.16.2-alpha" }, "require-dev": { "yoast/phpunit-polyfills": "1.1.0", diff --git a/composer.lock b/composer.lock index 5fec5712..4c7baf2f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,15 +4,15 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ba9365ba5e3880d576e06afaabfddcee", + "content-hash": "9e48c4463bb3faa61a354e745d0b2fcb", "packages": [ { "name": "automattic/jetpack-mu-wpcom", - "version": "4.16.1", + "version": "4.16.2-alpha.1698920672", "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom", - "reference": "53089b4c61704de508eb019982657f8399854679" + "reference": "635abaa77b6c4f70ab9c045802dff143e336923e" }, "require-dev": { "automattic/jetpack-changelogger": "^3.3.11", @@ -78,7 +78,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-changelogger", - "reference": "5c88f013995ec1c754153d8c7759c03584c9c047" + "reference": "6881c8093526b5a7c8a2793b2a81e67efaa66710" }, "require": { "php": ">=5.6", diff --git a/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md b/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md index a1bb3026..35642d17 100644 --- a/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md +++ b/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md @@ -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.16.2-alpha] - unreleased + +This is an alpha version! The changes listed here are not final. + +### Fixed +- Launchpad hooks: Made more resilient against non-array values + ## [4.16.1] - 2023-10-31 ### Fixed - Clicking on the 'Choose a plan' task would not redirect to the plans page. [#33872] @@ -414,6 +421,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Testing initial package release. +[4.16.2-alpha]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v4.16.1...v4.16.2-alpha [4.16.1]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v4.16.0...v4.16.1 [4.16.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v4.15.1...v4.16.0 [4.15.1]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v4.15.0...v4.15.1 diff --git a/vendor/automattic/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/vendor/automattic/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php index 93190b19..8a02b432 100644 --- a/vendor/automattic/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php +++ b/vendor/automattic/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php @@ -14,7 +14,7 @@ */ class Jetpack_Mu_Wpcom { - const PACKAGE_VERSION = '4.16.1'; + const PACKAGE_VERSION = '4.16.2-alpha'; const PKG_DIR = __DIR__ . '/../'; /** diff --git a/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php b/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php index d8d4deb4..5b976049 100644 --- a/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php +++ b/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php @@ -1702,13 +1702,15 @@ function wpcom_launchpad_is_edit_page_task_visible() { * if the subscription_options['invitation'] value * for the welcome message has changed on option update. * - * @param string $old_value The old value of the welcome message. - * @param string $value The new value of the welcome message. + * @param mixed $old_value The old value of the welcome message. + * @param mixed $value The new value of the welcome message. * * @return void */ function wpcom_launchpad_mark_customize_welcome_message_complete_on_update( $old_value, $value ) { - if ( $value['invitation'] !== $old_value['invitation'] ) { + $new_invitation = is_array( $value ) && isset( $value['invitation'] ) ? $value['invitation'] : ''; + $old_invitation = is_array( $old_value ) && isset( $old_value['invitation'] ) ? $old_value['invitation'] : ''; + if ( $new_invitation !== $old_invitation ) { wpcom_mark_launchpad_task_complete( 'customize_welcome_message' ); } } @@ -1719,12 +1721,12 @@ function wpcom_launchpad_mark_customize_welcome_message_complete_on_update( $old * if the subscription_options['invitation'] value * for the welcome message has been added. * - * @param string $value The value of the welcome message. + * @param mixed $value The value of the welcome message. * * @return void */ function wpcom_launchpad_mark_customize_welcome_message_complete_on_add( $value ) { - if ( $value['invitation'] ) { + if ( is_array( $value ) && $value['invitation'] ) { wpcom_mark_launchpad_task_complete( 'customize_welcome_message' ); } } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b7c22c36..c1c0c916 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2,12 +2,12 @@ "packages": [ { "name": "automattic/jetpack-mu-wpcom", - "version": "4.16.1", - "version_normalized": "4.16.1.0", + "version": "4.16.2-alpha.1698920672", + "version_normalized": "4.16.2.0-alpha1698920672", "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom", - "reference": "53089b4c61704de508eb019982657f8399854679" + "reference": "635abaa77b6c4f70ab9c045802dff143e336923e" }, "require-dev": { "automattic/jetpack-changelogger": "^3.3.11", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 68a4d7ec..18e2bb15 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -11,9 +11,9 @@ ), 'versions' => array( 'automattic/jetpack-mu-wpcom' => array( - 'pretty_version' => '4.16.1', - 'version' => '4.16.1.0', - 'reference' => '53089b4c61704de508eb019982657f8399854679', + 'pretty_version' => '4.16.2-alpha.1698920672', + 'version' => '4.16.2.0-alpha1698920672', + 'reference' => '635abaa77b6c4f70ab9c045802dff143e336923e', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../automattic/jetpack-mu-wpcom', 'aliases' => array(),