From d397db18b68963a47b39623d907a3a0134390f54 Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Mon, 31 Jul 2023 16:50:53 +0000
Subject: [PATCH] VirtualFolderType constructor: make sure the description
 field is initialised with an empty string if it isn't there, re #2986

Merge request studip/studip!2002
---
 lib/filesystem/VirtualFolderType.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/filesystem/VirtualFolderType.php b/lib/filesystem/VirtualFolderType.php
index e2236ee043e..ac868ca7afe 100644
--- a/lib/filesystem/VirtualFolderType.php
+++ b/lib/filesystem/VirtualFolderType.php
@@ -43,6 +43,11 @@ class VirtualFolderType implements FolderType
     public function __construct($folderdata = [], $plugin_id = null)
     {
         $this->folderdata = $folderdata;
+        //Make sure the description field is not empty so that folders
+        //of this type are compatible with StandardFolder types:
+        if (empty($this->folderdata['description'])) {
+            $this->folderdata['description'] = '';
+        }
         $this->plugin_id  = $plugin_id;
     }
 
-- 
GitLab