From 8f7a4bb9eb6a2ab87b7a7a34269637173096ad05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Mon, 5 Jun 2023 16:53:54 +0200 Subject: [PATCH] Fix Attempt to assign property "custommenuitems" on null error --- local/mymedia/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/local/mymedia/lib.php b/local/mymedia/lib.php index 2722f202..79169188 100644 --- a/local/mymedia/lib.php +++ b/local/mymedia/lib.php @@ -74,5 +74,7 @@ function local_mymedia_extend_navigation($navigation) { } $myMediaStr = "\n$menuHeaderStr|/local/mymedia/mymedia.php"; - $CFG->custommenuitems .= $myMediaStr; + if (empty($custommenuitems) && (isset($CFG->custommenuitems) && !empty($CFG->custommenuitems))) { + $CFG->custommenuitems .= $myMediaStr; + } }