mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix: ensure enabled (enforced) themes are always set on template layout
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
a35f4b16ac
commit
cfdd691f28
3 changed files with 24 additions and 15 deletions
|
|
@ -148,8 +148,7 @@ class ThemesService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the list of all enabled themes IDs
|
||||
* for the logged-in user
|
||||
* Get the list of all enabled themes IDs for the current user.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
|
|
|
|||
19
cypress/e2e/core/404-error.cy.ts
Normal file
19
cypress/e2e/core/404-error.cy.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
describe('404 error page', { testIsolation: true }, () => {
|
||||
it('renders 404 page', () => {
|
||||
cy.visit('/doesnotexist', { failOnStatusCode: false })
|
||||
|
||||
cy.findByRole('heading', { name: /Page not found/ })
|
||||
.should('be.visible')
|
||||
cy.findByRole('link', { name: /Back to Nextcloud/ })
|
||||
.should('be.visible')
|
||||
.click()
|
||||
|
||||
cy.url()
|
||||
.should('match', /(\/index.php)\/login$/)
|
||||
})
|
||||
})
|
||||
|
|
@ -80,12 +80,6 @@ class TemplateLayout {
|
|||
} else {
|
||||
Util::addScript('core', 'unified-search', 'core');
|
||||
}
|
||||
// Set body data-theme
|
||||
$page->assign('enabledThemes', []);
|
||||
if ($this->appManager->isEnabledForUser('theming') && class_exists('\OCA\Theming\Service\ThemesService')) {
|
||||
$themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
|
||||
$page->assign('enabledThemes', $themesService->getEnabledThemes());
|
||||
}
|
||||
|
||||
// Set logo link target
|
||||
$logoUrl = $this->config->getSystemValueString('logo_url', '');
|
||||
|
|
@ -157,13 +151,6 @@ class TemplateLayout {
|
|||
$page->assign('appid', $appId);
|
||||
$page->assign('bodyid', 'body-public');
|
||||
|
||||
// Set body data-theme
|
||||
$page->assign('enabledThemes', []);
|
||||
if ($this->appManager->isEnabledForUser('theming') && class_exists('\OCA\Theming\Service\ThemesService')) {
|
||||
$themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
|
||||
$page->assign('enabledThemes', $themesService->getEnabledThemes());
|
||||
}
|
||||
|
||||
// Set logo link target
|
||||
$logoUrl = $this->config->getSystemValueString('logo_url', '');
|
||||
$page->assign('logoUrl', $logoUrl);
|
||||
|
|
@ -203,6 +190,10 @@ class TemplateLayout {
|
|||
$page->assign('locale', $locale);
|
||||
$page->assign('direction', $direction);
|
||||
|
||||
// Set body data-theme
|
||||
$themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
|
||||
$page->assign('enabledThemes', $themesService->getEnabledThemes());
|
||||
|
||||
if ($this->config->getSystemValueBool('installed', false)) {
|
||||
if (empty(self::$versionHash)) {
|
||||
$v = $this->appManager->getAppInstalledVersions();
|
||||
|
|
|
|||
Loading…
Reference in a new issue