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

Regression caused by MDL-75864 fix

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5
    • Caching
    • None
    • MOODLE_405_STABLE
    • 2
    • Team Hedgehog 2025 Sprint 1.0, Team Hedgehogs 2025 Sprint 1.1

      The change to cache/stores/redis/lib.php in commit 4fbf34b73d3fb returns an empty array in case of not found.
      But perĀ \core_cache\helper::result_found(), only false is considered not found.
      This results in logic dependent on no found result being incorrectly skipped.

      (MOODLE_405_STABLE)~/dev/mdl$ git show 4fbf34b73d3fb -- cache/stores/redis/lib.php
       
      diff --git a/cache/stores/redis/lib.php b/cache/stores/redis/lib.php
      index 5c469056d85..7e3145324da 100644
      --- a/cache/stores/redis/lib.php
      +++ b/cache/stores/redis/lib.php
      @@ -384,7 +384,7 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_
            * @return array An array of the values of the given keys.
            */
           public function get_many($keys) {
      -        $values = $this->redis->hMGet($this->hash, $keys);
      +        $values = $this->redis->hMGet($this->hash, $keys) ?: [];
       
               if ($this->compressor == self::COMPRESSOR_NONE) {
                   return $values;
      

      cache/classes/helper.php
       
          public static function result_found($value): bool {
              return $value !== false;
          }
      

            Unassigned Unassigned
            sashaanastasi1 SashaAnastasi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.