diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2023-05-12 10:47:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 10:47:46 +0200 |
commit | 174c226c28fbedacbe6c83ee6e8979b2eaa74ce1 (patch) | |
tree | d1e29fa4b621463c53a91051137785a703b5e39b /lib | |
parent | 0d3df2c795ad1ae1222c1b3408fe02b7e2e1e1bf (diff) | |
parent | 31c01fa3da094897d2bffbbf2bd4848773c62c67 (diff) | |
download | nextcloud-server-174c226c28fbedacbe6c83ee6e8979b2eaa74ce1.tar.gz nextcloud-server-174c226c28fbedacbe6c83ee6e8979b2eaa74ce1.zip |
Merge pull request #38207 from nextcloud/fix/jsresourcelocator-l10n-handling
Diffstat (limited to 'lib')
-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', + ]); } /** |