From 16aff22cfd3f623602edcda5eeb90aff3a4fdf2a Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 17 Nov 2023 13:16:42 -0600 Subject: [PATCH 1/2] =?UTF-8?q?Don=E2=80=99t=20display=20next=20scheduled?= =?UTF-8?q?=20time=20when=20event=20is=20running?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/section/class-convertkit-admin-settings-broadcasts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/section/class-convertkit-admin-settings-broadcasts.php b/admin/section/class-convertkit-admin-settings-broadcasts.php index 99ef634f3..39ee1555d 100644 --- a/admin/section/class-convertkit-admin-settings-broadcasts.php +++ b/admin/section/class-convertkit-admin-settings-broadcasts.php @@ -157,8 +157,9 @@ public function register_fields() { // Define description for the 'Enabled' setting. // If enabled, include the next scheduled date and time the Plugin will import broadcasts. + // If the next scheduled timestamp is 1, the event is running now. $enabled_description = ''; - if ( $this->settings->enabled() && $posts->get_cron_event_next_scheduled() ) { + if ( $this->settings->enabled() && $posts->get_cron_event_next_scheduled() && $posts->get_cron_event_next_scheduled() > 1 ) { $enabled_description = sprintf( '%s %s', esc_html__( 'Broadcasts will next import at approximately ', 'convertkit' ), From 864f4527c287bb733741a84d48f67ed929223665 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 17 Nov 2023 13:23:13 -0600 Subject: [PATCH 2/2] Updated tests --- tests/acceptance/broadcasts/import/BroadcastsToPostsCest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/acceptance/broadcasts/import/BroadcastsToPostsCest.php b/tests/acceptance/broadcasts/import/BroadcastsToPostsCest.php index f647f77e6..4ab70a7ce 100644 --- a/tests/acceptance/broadcasts/import/BroadcastsToPostsCest.php +++ b/tests/acceptance/broadcasts/import/BroadcastsToPostsCest.php @@ -185,6 +185,9 @@ public function testBroadcastsManualImportWhenEnabled(AcceptanceTester $I) // Confirm a success message displays. $I->see('Broadcasts import started. Check the Posts screen shortly to confirm Broadcasts imported successfully.'); + // Confirm the next scheduled date/time is not displayed, as the event is running. + $I->dontSee('Broadcasts will next import at approximately'); + // Wait a few seconds for the Cron event to complete importing Broadcasts. $I->wait(7);