From 58dfd45765132142b30bda31501d2b49ce9c7460 Mon Sep 17 00:00:00 2001
From: Ron Lucke <lucke@elan-ev.de>
Date: Wed, 20 Oct 2021 09:47:05 +0000
Subject: [PATCH] fix BIEST #344

---
 lib/models/Courseware/BlockTypes/Audio.json    | 2 +-
 lib/models/Courseware/BlockTypes/Audio.php     | 6 +++---
 lib/models/Courseware/BlockTypes/BlockType.php | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/models/Courseware/BlockTypes/Audio.json b/lib/models/Courseware/BlockTypes/Audio.json
index 5ec4473897e..0606f8ea2d6 100755
--- a/lib/models/Courseware/BlockTypes/Audio.json
+++ b/lib/models/Courseware/BlockTypes/Audio.json
@@ -18,7 +18,7 @@
             "type": "string"
         },
         "recorder_enabled": {
-            "type": "string"
+            "type": "boolean"
         }
     },
     "required": [
diff --git a/lib/models/Courseware/BlockTypes/Audio.php b/lib/models/Courseware/BlockTypes/Audio.php
index 97c42888791..ae7e15abe3c 100755
--- a/lib/models/Courseware/BlockTypes/Audio.php
+++ b/lib/models/Courseware/BlockTypes/Audio.php
@@ -37,7 +37,7 @@ class Audio extends BlockType
             'file_id' => '',
             'folder_id' => '',
             'web_url' => '',
-            'recorder_enabled' => 'false'
+            'recorder_enabled' => false
         ];
     }
 
@@ -49,9 +49,9 @@ class Audio extends BlockType
     }
 
     /**
-     * get all files related to this bloc.
+     * get all files related to this block.
      *
-     * @return \FileRef[] list of file references realted to this block
+     * @return \FileRef[] list of file references related to this block
      */
     public function getFiles(): array
     {
diff --git a/lib/models/Courseware/BlockTypes/BlockType.php b/lib/models/Courseware/BlockTypes/BlockType.php
index 960ccad133b..0d994344d12 100755
--- a/lib/models/Courseware/BlockTypes/BlockType.php
+++ b/lib/models/Courseware/BlockTypes/BlockType.php
@@ -310,7 +310,7 @@ abstract class BlockType
                 $user
             );
 
-            return $copiedFile->id;
+            return isset($copiedFile) ? $copiedFile->id : '';
         }
 
         return '';
-- 
GitLab