More payload fixes for getFolderListing

This commit is contained in:
Djamil Legato
2019-06-05 16:08:39 -07:00
parent 7256a5645d
commit 032862780e

View File

@@ -1410,11 +1410,9 @@ class AdminController extends AdminBaseController
// Get data from post // Get data from post
$data = $this->post; $data = $this->post;
$data['route'] = $this->grav['uri']->param('route'); // For testing
$initial = (bool) $this->grav['uri']->param('initial'); // For testing
// Base64 decode the route // Base64 decode the route
$data['route'] = isset($data['route']) ? base64_decode($data['route']) : null; $data['route'] = isset($data['route']) ? base64_decode($data['route']) : null;
$initial = $data['initial'] ?? null;
if ($initial) { if ($initial) {
$data['leaf_route'] = $data['route']; $data['leaf_route'] = $data['route'];
@@ -1528,7 +1526,7 @@ class AdminController extends AdminBaseController
// Add children if any // Add children if any
if ($fileInfo->getPathname() == $extra && is_array($children)) { if ($fileInfo->getPathname() == $extra && is_array($children)) {
$payload['children'] = $children; $payload['children'] = array_values($children);
} }
$response[] = $payload; $response[] = $payload;