From ef2407d5d63cd38045e2ad34f1a97ef991beaf15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Noack?= <noack@data-quest.de>
Date: Thu, 10 Aug 2023 10:35:56 +0000
Subject: [PATCH] Resolve "Stud.IP-Cache funktioniert nicht mehr"

Closes #2979

Merge request studip/studip!2021
---
 lib/classes/StudipCacheWrapper.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/classes/StudipCacheWrapper.php b/lib/classes/StudipCacheWrapper.php
index 65c5edb2232..950e9a69222 100644
--- a/lib/classes/StudipCacheWrapper.php
+++ b/lib/classes/StudipCacheWrapper.php
@@ -61,7 +61,10 @@ class StudipCacheWrapper implements StudipCache
      */
     public function write($name, $content, $expires = self::DEFAULT_EXPIRATION)
     {
-        $this->memory_cache->expire($name);
-        $this->actual_cache->write($name, $content, $expires);
+        if ($this->actual_cache->write($name, $content, $expires)) {
+            return $this->memory_cache->write($name, $content, $expires);
+        } else {
+            return false;
+        }
     }
 }
-- 
GitLab