From 1a781ccf5610efa7a2f09c059b135d6eff674728 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 24 Aug 2022 18:55:34 +0200 Subject: [PATCH 1/2] Fix opening Help page throws Exception - Commit 458c2fa2971e6595a18a289b0afeb4a79ea0e0d3 provoked the error, because the "core" "app" was not found. Previously, false was returned, but now an AppPathNotFoundException - IUrlGenerator::linkTo() accepts an empty app argument however, moving the "core" portion to the path solves it and avoids apps lookup Signed-off-by: Arthur Schiwon --- apps/settings/lib/Controller/HelpController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/settings/lib/Controller/HelpController.php b/apps/settings/lib/Controller/HelpController.php index 8a62fb9b58c..b8780ae40ba 100644 --- a/apps/settings/lib/Controller/HelpController.php +++ b/apps/settings/lib/Controller/HelpController.php @@ -79,7 +79,7 @@ class HelpController extends Controller { } $documentationUrl = $this->urlGenerator->getAbsoluteURL( - $this->urlGenerator->linkTo('core', 'doc/' . $mode . '/index.html') + $this->urlGenerator->linkTo('', 'core/doc/' . $mode . '/index.html') ); $urlUserDocs = $this->urlGenerator->linkToRoute('settings.Help.help', ['mode' => 'user']); From 9f9da2eaa8a7b35fed04d9e676f30495e1a11263 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 24 Aug 2022 19:09:05 +0200 Subject: [PATCH 2/2] app_path cannot be empty Signed-off-by: Arthur Schiwon --- lib/private/URLGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 6115d4a221e..7be2895a1ef 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -146,7 +146,7 @@ class URLGenerator implements IURLGenerator { if ($appName !== '') { $app_path = $this->getAppManager()->getAppPath($appName); // Check if the app is in the app folder - if ($app_path && file_exists($app_path . '/' . $file)) { + if (file_exists($app_path . '/' . $file)) { if (substr($file, -3) === 'php') { $urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $appName; if ($frontControllerActive) {