diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc index 773e3e2..d5f3593 100644 --- a/core/modules/update/update.fetch.inc +++ b/core/modules/update/update.fetch.inc @@ -378,7 +378,7 @@ function _update_cron_notify() { // Track when the last mail was successfully sent to avoid sending // too many e-mails. if ($message['result']) { - variable_set('update_last_email_notification', REQUEST_TIME); + state()->set('update.last_email_notification', REQUEST_TIME); } } } diff --git a/core/modules/update/update.install b/core/modules/update/update.install index 202b865..61a50c1 100644 --- a/core/modules/update/update.install +++ b/core/modules/update/update.install @@ -77,9 +77,7 @@ function update_install() { * Implements hook_uninstall(). */ function update_uninstall() { - state()->delete('update.last_check'); - // @todo D8: Convert to new state storage. - variable_del('update_last_email_notification'); + state()->deleteMultiple(array('update.last_check', 'update.last_email_notification')); $queue = queue('update_fetch_tasks'); $queue->deleteQueue(); diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 8eee677..c59e2fd 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -297,7 +297,9 @@ function update_cron() { // missing data, and if so, try to fetch the data. update_get_available(TRUE); } - if ((REQUEST_TIME - variable_get('update_last_email_notification', 0)) > $interval) { + + $last_email_notice = state()->get('update.last_email_notification') ?: 0; + if ((REQUEST_TIME - $last_email_notice) > $interval) { // If configured time between notifications elapsed, send email about // updates possibly available. module_load_include('inc', 'update', 'update.fetch');