From 04af12691c6800976cd7e74068c100c4159c9625 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 10 Jul 2023 15:14:42 -0300 Subject: [PATCH] Remove deprecated method Fix the follow error: ``` Message: Call to undefined method OC_App::getNavigation() in file '/var/www/html/apps-extra/side_menu/lib/Service/AppRepository.php' line 54 ``` Reference: https://github.com/nextcloud/server/commit/167763d3125779fc642f7b169389dea029bb73ed Signed-off-by: Vitor Mattos --- lib/Service/AppRepository.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Service/AppRepository.php b/lib/Service/AppRepository.php index ce96107..ae865ce 100644 --- a/lib/Service/AppRepository.php +++ b/lib/Service/AppRepository.php @@ -3,6 +3,7 @@ namespace OCA\SideMenu\Service; use OC\User\User; +use OCP\INavigationManager; use OCP\L10N\IFactory; /** @@ -34,6 +35,7 @@ class AppRepository public function __construct( \OC_App $ocApp, + protected INavigationManager $navigationManager, IFactory $l10nFactory, ConfigProxy $config, CategoryRepository $categoryRepository @@ -51,7 +53,7 @@ class AppRepository */ public function getVisibleApps() { - $navigation = $this->ocApp->getNavigation(); + $navigation = $this->navigationManager->getAll(); $appCategoriesCustom = $this->config->getAppValueArray('apps-categories-custom', '[]'); $categories = $this->categoryRepository->getOrderedCategories(); $apps = $this->ocApp->listAllApps();