Commit 93fea41f authored by Benjamin Melançon's avatar Benjamin Melançon Committed by David Valdez
Browse files

Issue #2834528 by mlncn: Use of Drupal 8.3.x code causing error on cron in Drupal 8.2.x

parent ec98b720
Loading
Loading
Loading
Loading
+2 −1
Changes for personal_digest.module: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -163,10 +163,11 @@ function personal_digest_user_settings_elements_submit($form, $form_state) {
 * Queue the digest emails.
 *
 * @todo this will run out of memory if there is a large number of users.
 * @todo REQUEST_TIME is deprecated in Core 8.3.x but \Drupal::time() is not in 8.2.x
 */
function personal_digest_cron() {
  $dayOfWeek = date('l');
  $now = \Drupal::time()->getRequestTime();
  $now = REQUEST_TIME;
  $last_cron = \Drupal::state()->get('personal_digest_last_cron', -1);
  // If now is on a different day to the last cron.
  if (date('z', $now) != date('z', $last_cron)) {