Skip to content

Commit

Permalink
Merge pull request #45737 from nextcloud/jtr/fix-appmanager-checkappf…
Browse files Browse the repository at this point in the history
…orX-log

fix(AppManager): Name correct method in error + show error string
  • Loading branch information
joshtrichards committed Jun 10, 2024
2 parents 21a0009 + c494a0c commit 4e3aaec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/private/App/AppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ private function checkAppForUser(string $enabled, ?IUser $user): bool {

if (!is_array($groupIds)) {
$jsonError = json_last_error();
$this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError);
$jsonErrorMsg = json_last_error_msg();
// this really should never happen (if it does, the admin should check the `enabled` key value via `occ config:list` because it's bogus for some reason)
$this->logger->warning('AppManager::checkAppForUser - can\'t decode group IDs listed in app\'s enabled config key: ' . print_r($enabled, true) . ' - JSON error (' . $jsonError . ') ' . $jsonErrorMsg);
return false;
}

Expand All @@ -345,7 +347,9 @@ private function checkAppForGroups(string $enabled, IGroup $group): bool {

if (!is_array($groupIds)) {
$jsonError = json_last_error();
$this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError);
$jsonErrorMsg = json_last_error_msg();
// this really should never happen (if it does, the admin should check the `enabled` key value via `occ config:list` because it's bogus for some reason)
$this->logger->warning('AppManager::checkAppForGroups - can\'t decode group IDs listed in app\'s enabled config key: ' . print_r($enabled, true) . ' - JSON error (' . $jsonError . ') ' . $jsonErrorMsg);
return false;
}

Expand Down

0 comments on commit 4e3aaec

Please sign in to comment.