From efbca8972d99bba1849a7350bf54f03fccbf4f58 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 2 Aug 2023 13:56:18 +0200 Subject: [PATCH] Group: Fix issue preventing group members from seeing documents uploaded by the teacher - refs #4829 --- main/document/document.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/main/document/document.php b/main/document/document.php index 7f5221609c..1191720b8b 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -2185,13 +2185,19 @@ if ($isAllowedToEdit || $table->set_column_filter( $column - 1, function ($value) { - return DocumentManager::build_edit_icons( - $value['document_data'], - $value['key'], - $value['is_template'], - $value['readonly'], - $value['is_visible'] - ); + if (is_array($value['document_data'])) { + // If the document is not visible by the user, the document_data is an empty string so we cannot call + // the method. + return DocumentManager::build_edit_icons( + $value['document_data'], + $value['key'], + $value['is_template'], + $value['readonly'], + $value['is_visible'] + ); + } else { + return ''; + } } ); }