From b262c30fa9780290ecd0411cee2c4da5c24066b2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 24 Mar 2015 12:56:42 +0100 Subject: Correctly get array of groups and send OCP\IGroup objects to enable method --- lib/private/app.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/app.php b/lib/private/app.php index 1b004154173..dce159d574c 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -269,7 +269,15 @@ class OC_App { $appManager = \OC::$server->getAppManager(); if (!is_null($groups)) { - $appManager->enableAppForGroups($app, $groups); + $groupManager = \OC::$server->getGroupManager(); + $groupsList = []; + foreach ($groups as $group) { + $groupItem = $groupManager->get($group); + if ($groupItem instanceof \OCP\IGroup) { + $groupsList[] = $groupManager->get($group); + } + } + $appManager->enableAppForGroups($app, $groupsList); } else { $appManager->enableApp($app); } -- cgit v1.2.3