From 032862780eda0a2ef75d26bbac727916068c6ec9 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Wed, 5 Jun 2019 16:08:39 -0700 Subject: [PATCH] More payload fixes for getFolderListing --- classes/plugin/AdminController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/classes/plugin/AdminController.php b/classes/plugin/AdminController.php index 959a0ea4..fb6e1c81 100644 --- a/classes/plugin/AdminController.php +++ b/classes/plugin/AdminController.php @@ -1410,11 +1410,9 @@ class AdminController extends AdminBaseController // Get data from 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 $data['route'] = isset($data['route']) ? base64_decode($data['route']) : null; + $initial = $data['initial'] ?? null; if ($initial) { $data['leaf_route'] = $data['route']; @@ -1528,7 +1526,7 @@ class AdminController extends AdminBaseController // Add children if any if ($fileInfo->getPathname() == $extra && is_array($children)) { - $payload['children'] = $children; + $payload['children'] = array_values($children); } $response[] = $payload;