Skip to content

Commit 836a3e8

Browse files
committed
fix: fallback to default cron period when setting is not yet initialized
On fresh activation, getSetting() returns a non-string value before settings are saved, triggering a warning. Fall back to 'ntfn_week' (the registered default) instead of erroring.
1 parent 0c4c8c7 commit 836a3e8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo
297297

298298
== Changelog ==
299299

300+
= [Next] =
301+
* [Fixed] Warning on activation when cron period setting is not yet initialized
302+
300303
= 9.0.9 =
301304
* [Fixed] Plugin crash on certain hosting configurations due to missing build file
302305

src/Core/Cron.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ public function registerCheckUpdatesEvent()
7272
$schedule = \Notification::settings()->getSetting('triggers/wordpress/updates_cron_period');
7373

7474
if (! is_string($schedule)) {
75-
ErrorHandler::error('Update cron period is not a string');
76-
return;
75+
$schedule = 'ntfn_week';
7776
}
7877

7978
if ($event === false) {

0 commit comments

Comments
 (0)