mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-29 09:16:48 +01:00
Smarter handling of symlinks in parent field
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# v1.10.0-beta.3
|
# v1.10.0-beta.3
|
||||||
## mm/dd/2019
|
## mm/dd/2019
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Smarter handling of symlinks in parent field
|
||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixed issue with windows paths in `parent` field [#1699](https://github.com/getgrav/grav-plugin-admin/issues/1699)
|
* Fixed issue with windows paths in `parent` field [#1699](https://github.com/getgrav/grav-plugin-admin/issues/1699)
|
||||||
|
|
||||||
|
|||||||
@@ -2247,7 +2247,6 @@ class AdminController extends AdminBaseController
|
|||||||
// Valid types are dir|file|link
|
// Valid types are dir|file|link
|
||||||
$default_filters = ['type'=> ['root', 'dir'], 'name' => null, 'extension' => null];
|
$default_filters = ['type'=> ['root', 'dir'], 'name' => null, 'extension' => null];
|
||||||
|
|
||||||
|
|
||||||
$page_instances = Grav::instance()['pages']->instances();
|
$page_instances = Grav::instance()['pages']->instances();
|
||||||
|
|
||||||
$is_page = $data['page'] ?? true;
|
$is_page = $data['page'] ?? true;
|
||||||
@@ -2354,13 +2353,16 @@ class AdminController extends AdminBaseController
|
|||||||
'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(),
|
'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(),
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'modified' => $fileInfo->getMTime(),
|
'modified' => $fileInfo->getMTime(),
|
||||||
'size' => $fileInfo->getSize()
|
'size' => $fileInfo->getSize(),
|
||||||
|
'symlink' => false
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix for symlink
|
// Fix for symlink
|
||||||
if ($payload['type'] === 'link' && $payload['extension'] === '') {
|
if ($payload['type'] === 'link') {
|
||||||
$payload['type'] = 'dir';
|
$payload['symlink'] = true;
|
||||||
|
$physical_path = $fileInfo->getRealPath();
|
||||||
|
$payload['type'] = is_dir($physical_path) ? 'dir' : 'file';
|
||||||
}
|
}
|
||||||
|
|
||||||
// filter types
|
// filter types
|
||||||
|
|||||||
Reference in New Issue
Block a user