Warning: foreach() argument must be of type array|object, string given in _update_cron_notify()

Created on 3 July 2023, over 1 year ago
Updated 20 July 2023, over 1 year ago

Problem/Motivation

Facing the following warning message on cron run

Steps to reproduce

After updating to Drupal ~10.1.0
With Ultimate Cron ~2.0 enabled on the system.

Warning: foreach() argument must be of type array|object, string given in _update_cron_notify() (line 37 of /var/www/html/dev/drupal10-1-0/docroot/core/modules/update/update.fetch.inc)
#0 /var/www/html/dev/drupal10-1-0/docroot/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 /var/www/html/dev/drupal10-1-0/docroot/core/modules/update/update.fetch.inc(37): _drupal_error_handler()
#2 /var/www/html/dev/drupal10-1-0/docroot/core/modules/update/update.module(193): _update_cron_notify()
#3 [internal function]: update_cron()
#4 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/Entity/CronJob.php(325): call_user_func()
#5 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/Entity/CronJob.php(471): Drupal\ultimate_cron\Entity\CronJob->invokeCallback()
#6 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/Plugin/ultimate_cron/Launcher/SerialLauncher.php(213): Drupal\ultimate_cron\Entity\CronJob->run()
#7 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/Plugin/ultimate_cron/Launcher/SerialLauncher.php(334): Drupal\ultimate_cron\Plugin\ultimate_cron\Launcher\SerialLauncher->launch()
#8 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/Plugin/ultimate_cron/Launcher/SerialLauncher.php(309): Drupal\ultimate_cron\Plugin\ultimate_cron\Launcher\SerialLauncher->runThread()
#9 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/UltimateCron.php(64): Drupal\ultimate_cron\Plugin\ultimate_cron\Launcher\SerialLauncher->launchJobs()
#10 /var/www/html/dev/drupal10-1-0/docroot/modules/contrib/ultimate_cron/src/ProxyClass/UltimateCron.php(70): Drupal\ultimate_cron\UltimateCron->run()
#11 /var/www/html/dev/drupal10-1-0/docroot/core/includes/install.core.inc(1868): Drupal\ultimate_cron\ProxyClass\UltimateCron->run()
#12 /var/www/html/dev/drupal10-1-0/docroot/profiles/contrib/varbase/varbase.profile(671): install_finished()
#13 /var/www/html/dev/drupal10-1-0/docroot/core/includes/install.core.inc(698): varbase_after_install_finished()
#14 /var/www/html/dev/drupal10-1-0/docroot/core/includes/install.core.inc(569): install_run_task()
#15 /var/www/html/dev/drupal10-1-0/docroot/core/includes/install.core.inc(119): install_run_tasks()
#16 /var/www/html/dev/drupal10-1-0/docroot/core/install.php(48): install_drupal()
#17 {main}

Proposed resolution

Have the message type changed in Drupal from string to array|object?
Not sure where to change to fix this.
Drupal ~10.1.0 core? or in Ultimate Cron?
Or maybe custom coded batch jobs?

Remaining tasks

  • File an issue
  • Patch/MR
  • Test
  • Review

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A
🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024