From 0cfc7e031c8e4e88a1a18edd88e8c8849bb3652d Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 22 May 2020 10:32:30 -0600 Subject: [PATCH] Fixes for broken parents field --- classes/plugin/AdminController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/plugin/AdminController.php b/classes/plugin/AdminController.php index f6b6536a..9a6e25d2 100644 --- a/classes/plugin/AdminController.php +++ b/classes/plugin/AdminController.php @@ -2437,8 +2437,8 @@ class AdminController extends AdminBaseController $file_path = Utils::replaceFirstOccurrence(GRAV_ROOT, '', $filePath); $type = $fileInfo->getType(); - $child_path = $file_page ? GRAV_ROOT . $file_page->path() : $filePath; - $has_children = Folder::hasChildren($child_path); + $child_path = $file_page ? $file_page->path() : $filePath; + $count_children = Folder::countChildren($child_path); $payload = [ 'name' => $file_page ? $file_page->title() : $fileName, @@ -2448,9 +2448,9 @@ class AdminController extends AdminBaseController 'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(), 'type' => $type, 'modified' => $fileInfo->getMTime(), - 'size' => $fileInfo->getSize(), + 'size' => $count_children, 'symlink' => false, - 'has-children' => $has_children + 'has-children' => $count_children > 0 ]; }