Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60847

Error on cron run in cache/classes/helper.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.3.2, 3.3.3, 3.4, 3.4.1, 3.4.2, 3.4.9, 3.5.1, 3.5.6, 3.5.7, 3.5.8, 3.6.4, 3.6.5, 3.6.6, 3.7, 3.7.1, 3.7.2
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE

      Description

      It can happen that the array $store is empty (using redis)

      Add (array) to the foreach will solve this problem:

      foreach ((array) $store->get_many($keys) as $key => $value) {

       

      Original Message i get per mail from cron job:

      PHP Warning:  Invalid argument supplied for foreach() in
      /var/www/moodle/cache/classes/helper.php on
      line 707
      PHP Warning:  Invalid argument supplied for foreach() in
      /var/www/moodle/cache/classes/helper.php on
      line 707
      PHP Warning:  Invalid argument supplied for foreach() in
      /var/www/moodle/cache/classes/helper.php on
      line 707
      PHP Warning:  Invalid argument supplied for foreach() in
      /var/www/moodle/cache/classes/helper.php on
      line 707
      PHP Warning:  Invalid argument supplied for foreach() in
      /var/www/moodle/cache/classes/helper.php on
      line 707
      PHP Warning:  Invalid argument supplied for foreach() in
      /var/www/moodle/cache/classes/helper.php on
      line 707

        Attachments

          Activity

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: