From 99d748deeddcb37671cba39731c51485db8d353a Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Wed, 17 Apr 2024 16:53:51 +0300 Subject: [PATCH] fixed ExApp with one scope(llm2 for example) installation error Signed-off-by: Alexander Piskun --- lib/Service/ExAppService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Service/ExAppService.php b/lib/Service/ExAppService.php index 5845c7e6..3eb840f1 100644 --- a/lib/Service/ExAppService.php +++ b/lib/Service/ExAppService.php @@ -274,7 +274,11 @@ public function getAppInfo(string $appId, ?string $infoXml, ?string $jsonInfo): } $appInfo = json_decode(json_encode((array)$xmlAppInfo), true); if (isset($appInfo['external-app']['scopes']['value'])) { - $appInfo['external-app']['scopes'] = $appInfo['external-app']['scopes']['value']; + if (is_array($appInfo['external-app']['scopes']['value'])) { + $appInfo['external-app']['scopes'] = $appInfo['external-app']['scopes']['value']; + } else { + $appInfo['external-app']['scopes'] = [$appInfo['external-app']['scopes']['value']]; + } } if ($extractedDir) { if (file_exists($extractedDir . '/l10n')) { @@ -283,10 +287,6 @@ public function getAppInfo(string $appId, ?string $infoXml, ?string $jsonInfo): $this->logger->info(sprintf('Application %s does not support translations', $appId)); } } - # TO-DO: remove this in AppAPI 2.3.0 - if (isset($appInfo['external-app']['scopes']['required']['value'])) { - $appInfo['external-app']['scopes'] = $appInfo['external-app']['scopes']['required']['value']; - } } return $appInfo; }