Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/theming/lib/Service/ThemesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ public function isEnabled(ITheme $theme): bool {
}

/**
* 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[]
*/
Expand Down
19 changes: 19 additions & 0 deletions cypress/e2e/core/404-error.cy.ts
Original file line number Diff line number Diff line change
@@ -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$/)
})
})
17 changes: 4 additions & 13 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public function getPageTemplate(string $renderAs, string $appId): ITemplate {
} 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', '');
Expand Down Expand Up @@ -157,13 +151,6 @@ public function getPageTemplate(string $renderAs, string $appId): ITemplate {
$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);
Expand Down Expand Up @@ -203,6 +190,10 @@ public function getPageTemplate(string $renderAs, string $appId): ITemplate {
$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();
Expand Down
Loading