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
4 changes: 3 additions & 1 deletion core/templates/layout.guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
<?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
<body id="<?php p($_['bodyid']);?>">
<body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
p("data-theme-$themeId ");
}?> data-themes="<?php p(join(',', $_['enabledThemes'])) ?>">
Comment on lines +38 to +40
Copy link
Member

@nickvergessen nickvergessen Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks public/error pages it seems:

2025-04-03T20:40:27.000 m88 IP PHP          Undefined array key "enabledThemes" at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#38                                                           │
2025-04-03T20:40:28.000 m88 IP PHP          foreach() argument must be of type array|object, null given at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#38                                   │
2025-04-03T20:40:28.000 m88 IP PHP          Undefined array key "enabledThemes" at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#40                                                           │
2025-04-03T20:40:28.000 m88 IP core         Rendering themed error page failed. Falling back to un-themed error page.                                                                                                  │
2025-04-03T20:40:28.000 m88 IP PHP          Undefined array key "enabledThemes" at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#38                                                           │
2025-04-03T20:40:29.000 m88 IP PHP          foreach() argument must be of type array|object, null given at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#38                                   │
2025-04-03T20:40:29.000 m88 IP PHP          Undefined array key "enabledThemes" at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#40                                                           │
2025-04-03T20:40:29.000 m88 IP index        join(): Argument #1 ($pieces) must be of type array, string given                                                                                                          │
2025-04-03T20:40:29.000 m88 IP PHP          Undefined array key "enabledThemes" at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#38                                                           │
2025-04-03T20:40:29.000 m88 IP PHP          foreach() argument must be of type array|object, null given at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#38                                   │
2025-04-03T20:40:30.000 m88 IP PHP          Undefined array key "enabledThemes" at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#40                                                           │
2025-04-03T20:40:30.000 m88 IP PHP          TypeError: join(): Argument #1 ($pieces) must be of type array, string given at /var/www/cloud.nextcloud.com/nextcloud/core/templates/layout.guest.php#40     

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easiest to demo is:
https://localhost/index.php/doesnotexist instead of an error message you will only see the background.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<?php include 'layout.noscript.warning.php'; ?>
<?php include 'layout.initial-state.php'; ?>
<div class="wrapper">
Expand Down
2 changes: 2 additions & 0 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public function __construct($renderAs, $appId = '') {
if ($user) {
$userDisplayName = $user->getDisplayName();
}
$theme = $this->config->getSystemValueString('enforce_theme', '');
$this->assign('enabledThemes', $theme === '' ? [] : [$theme]);
$this->assign('user_displayname', $userDisplayName);
$this->assign('user_uid', \OC_User::getUser());
} elseif ($renderAs === TemplateResponse::RENDER_AS_PUBLIC) {
Expand Down
Loading