summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-07-25 13:50:46 +0200
committerJulius Härtl <jus@bitgrid.net>2018-07-25 13:50:46 +0200
commit4c773891d738c732f525030aa1d0dd187c4221ec (patch)
tree8065313e401b8017a6e86420d6eeb4e8076e4490
parent8e81bc78951a7e47ec840dab6b250f191537b4c5 (diff)
downloadnextcloud-server-4c773891d738c732f525030aa1d0dd187c4221ec.tar.gz
nextcloud-server-4c773891d738c732f525030aa1d0dd187c4221ec.zip
Fix app navigation controller to return an array
This is required to not break compatibility with existing consumers of that endpoint like the apps management or the client Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--core/Controller/NavigationController.php3
-rw-r--r--settings/js/apps.js2
-rw-r--r--tests/Core/Controller/NavigationControllerTest.php4
3 files changed, 5 insertions, 4 deletions
diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php
index 2397fb3c7b4..eb3b0968da3 100644
--- a/core/Controller/NavigationController.php
+++ b/core/Controller/NavigationController.php
@@ -55,7 +55,7 @@ class NavigationController extends OCSController {
if ($absolute) {
$navigation = $this->rewriteToAbsoluteUrls($navigation);
}
-
+ $navigation = array_values($navigation);
$etag = $this->generateETag($navigation);
if ($this->request->getHeader('If-None-Match') === $etag) {
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
@@ -77,6 +77,7 @@ class NavigationController extends OCSController {
if ($absolute) {
$navigation = $this->rewriteToAbsoluteUrls($navigation);
}
+ $navigation = array_values($navigation);
$etag = $this->generateETag($navigation);
if ($this->request->getHeader('If-None-Match') === $etag) {
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
diff --git a/settings/js/apps.js b/settings/js/apps.js
index c9b1ea6b8d4..641e8999b19 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -6,7 +6,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
if(response.ocs.meta.status === 'ok') {
var addedApps = {};
var navEntries = response.ocs.data;
- var container = $('#navigation #apps');
+ var container = $('#navigation #apps ul');
// remove disabled apps
for (var i = 0; i < navEntries.length; i++) {
diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php
index 86173405c1c..4095526fc0b 100644
--- a/tests/Core/Controller/NavigationControllerTest.php
+++ b/tests/Core/Controller/NavigationControllerTest.php
@@ -69,7 +69,7 @@ class NavigationControllerTest extends TestCase {
$this->navigationManager->expects($this->once())
->method('getAll')
->with('link')
- ->willReturn([ ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ]);
+ ->willReturn(['files' => ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ]);
if ($absolute) {
$this->urlGenerator->expects($this->any())
->method('getBaseURL')
@@ -102,7 +102,7 @@ class NavigationControllerTest extends TestCase {
$this->navigationManager->expects($this->once())
->method('getAll')
->with('settings')
- ->willReturn([ ['id' => 'settings', 'href' => '/index.php/settings/user', 'icon' => '/core/img/settings.svg'] ]);
+ ->willReturn(['settings' => ['id' => 'settings', 'href' => '/index.php/settings/user', 'icon' => '/core/img/settings.svg'] ]);
if ($absolute) {
$this->urlGenerator->expects($this->any())
->method('getBaseURL')