diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-05-11 17:51:55 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-05-11 18:22:24 +0200 |
commit | 31c01fa3da094897d2bffbbf2bd4848773c62c67 (patch) | |
tree | 762abd6ad1e6cf063803fe105518a3679a161bc1 /lib/private | |
parent | 9d2d3d482bce004d134dd87d7b37c3dfb6513412 (diff) | |
download | nextcloud-server-31c01fa3da094897d2bffbbf2bd4848773c62c67.tar.gz nextcloud-server-31c01fa3da094897d2bffbbf2bd4848773c62c67.zip |
fix(JSResourceLocator): Handle missing translations silently
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Template/JSResourceLocator.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php index 120234146e1..61611c69b0f 100644 --- a/lib/private/Template/JSResourceLocator.php +++ b/lib/private/Template/JSResourceLocator.php @@ -99,21 +99,28 @@ class JSResourceLocator extends ResourceLocator { // gets turned into cwd. $app_path = realpath($app_path); - // missing translations files will be ignored - if (strpos($script, 'l10n/') === 0) { - $this->appendScriptIfExist($app_path, $script, $app_url); + // check combined files + if ($this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { return; } - if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { - $this->appendScriptIfExist($app_path, $script, $app_url); + // fallback to plain file location + if ($this->appendScriptIfExist($app_path, $script, $app_url)) { + return; } } catch (AppPathNotFoundException) { - $this->logger->error('Could not find resource {resource} to load', [ - 'resource' => $app . '/' . $script . '.js', - 'app' => 'jsresourceloader', - ]); + // pass (general error handling happens below) } + + // missing translations files will be ignored + if (strpos($script, 'l10n/') === 0) { + return; + } + + $this->logger->error('Could not find resource {resource} to load', [ + 'resource' => $app . '/' . $script . '.js', + 'app' => 'jsresourceloader', + ]); } /** |