From 9037aa86452ad5eecb95ef798bc3d316c17ed17e Mon Sep 17 00:00:00 2001 From: g4b0 Date: Mon, 18 Mar 2013 17:18:58 +0100 Subject: [PATCH] Re-indexed disallowed array because of json_encode issue with non-sequential array --- code/controllers/CMSMain.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 9298b81d..a0cf65f4 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -422,7 +422,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr // then add the ones which are globally disallowed. $disallowed = array_diff($classes, (array)$allowed); $disallowed = array_unique(array_merge($disallowed, $globalDisallowed)); - if($disallowed) $def[$class]['disallowedChildren'] = $disallowed; + // Re-index the array for JSON non sequential key issue + if($disallowed) $def[$class]['disallowedChildren'] = array_values($disallowed); $defaultChild = $obj->defaultChild(); if($defaultChild != 'Page' && $defaultChild != null) {