mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-12-20 15:30:46 +01:00
Fixes for broken parents field
This commit is contained in:
@@ -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
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user