From 133a4952e442e5e98029df6c6dd0ec6bfbea3d36 Mon Sep 17 00:00:00 2001 From: nghiem-mb Date: Mon, 30 Oct 2023 13:31:48 +0700 Subject: [PATCH] CustomContentsService --- .../src/Service/CustomContentsService.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/bc-custom-content/src/Service/CustomContentsService.php b/plugins/bc-custom-content/src/Service/CustomContentsService.php index 96fddc96d6..753731b021 100644 --- a/plugins/bc-custom-content/src/Service/CustomContentsService.php +++ b/plugins/bc-custom-content/src/Service/CustomContentsService.php @@ -13,13 +13,13 @@ use BaserCore\Error\BcException; use BaserCore\Utility\BcContainerTrait; +use BaserCore\Utility\BcFolder; use BaserCore\Utility\BcUtil; use BcCustomContent\Model\Table\CustomContentsTable; use Cake\Core\App; use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\Datasource\EntityInterface; -use Cake\Filesystem\Folder; use Cake\ORM\Query; use Cake\ORM\TableRegistry; use BaserCore\Annotation\UnitTest; @@ -269,13 +269,13 @@ public function getTemplates(int $siteId): array $templates = []; foreach($templatesPaths as $templatePath) { $templatePath .= 'CustomContent' . DS; - $folder = new Folder($templatePath); - $files = $folder->read(true, true); - if ($files[0]) { + $folder = new BcFolder($templatePath); + $files = $folder->getFolders(); + if ($files) { if ($templates) { - $templates = array_merge($templates, $files[0]); + $templates = array_merge($templates, $files); } else { - $templates = $files[0]; + $templates = $files; } } }