diff --git a/lib/Controller/Folder.php b/lib/Controller/Folder.php index ac69110173..f6b6ff6598 100644 --- a/lib/Controller/Folder.php +++ b/lib/Controller/Folder.php @@ -123,7 +123,11 @@ private function buildTreeView(\Xibo\Entity\Folder $folder, int $homeFolderId) $folder->type = 'home'; } - $children = array_filter(explode(',', $folder->children)); + if (!empty($folder->children)) { + $children = array_filter(explode(',', $folder->children)); + } else { + $children = []; + } $childrenDetails = []; foreach ($children as $childId) { diff --git a/lib/Entity/ModulePropertyTrait.php b/lib/Entity/ModulePropertyTrait.php index dbea293b13..a4a613e520 100644 --- a/lib/Entity/ModulePropertyTrait.php +++ b/lib/Entity/ModulePropertyTrait.php @@ -2,7 +2,7 @@ /* * Copyright (C) 2023 Xibo Signage Ltd * - * Xibo - Digital Signage - http://www.xibo.org.uk + * Xibo - Digital Signage - https://xibosignage.com * * This file is part of Xibo. * @@ -70,7 +70,7 @@ public function getPropertyValues(bool $decorateForOutput = true): array // TODO: should we cast values to their appropriate field formats. if ($decorateForOutput) { // Does this property have library references? - if ($property->allowLibraryRefs) { + if ($property->allowLibraryRefs && !empty($value)) { // Parse them out and replace for our special syntax. $matches = []; preg_match_all('/\[(.*?)\]/', $value, $matches);