nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.19k stars 4.04k forks source link

[Bug]: NC 25 Custom wallpaper not working #34211

Closed PVince81 closed 2 years ago

PVince81 commented 2 years ago

⚠️ This issue respects the following points: ⚠️

Bug description

The customer wallpaper doesn't appear on any pages even after a hard refresh.

Steps to reproduce

  1. Setup NC 25.0.0 RC1 (in my case also locally stable25 from git)
  2. Create a folder "wallpapers"
  3. Upload the attached file there
  4. Go to "Appearance and settings" in the settings page
  5. Scroll down
  6. Click "Pick a file" and select the image file
  7. Refresh the page with Shift+F5
  8. Go to the files app, refresh with Shift+F5

Expected behavior

Wallpaper must be applied on all pages, not only the theming section.

Installation method

Other Community project

Operating system

No response

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database engine version

No response

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

- cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.0
  - files_external: 1.17.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - lookup_server_connector: 1.13.0
  - oauth2: 1.13.0
  - provisioning_api: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - systemtags: 1.15.0
  - theming: 2.0.0
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.8.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0

### Nextcloud Signing status

_No response_

### Nextcloud Logs

```shell
{"reqId":"joSxuDhlV2TPO7Z3ZadZ","level":1,"time":"2022-09-23T08:39:25+00:00","remoteAddr":"127.0.0.1","user":"admin","app":"no app in context","method":"GET","url":"/index.php/apps/theming/theme/dark-highcontrast.css?plain=0","message":"Unable to generate a URL for the named route \"theming.theming.getBackground\" as such route does not exist.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"25.0.0.13","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"theming.theming.getBackground\" as such route does not exist.","Code":0,"Trace":[{"file":"/srv/www/htdocs/server/lib/private/Route/Router.php","line":361,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["theming.theming.getBackground",[],1]},{"file":"/srv/www/htdocs/server/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["theming.theming.getBackground",[]]},{"file":"/srv/www/htdocs/server/lib/private/URLGenerator.php","line":115,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["theming.theming.getBackground",[]]},{"file":"/srv/www/htdocs/server/apps/theming/lib/Themes/DefaultTheme.php","line":248,"function":"linkToRouteAbsolute","class":"OC\\URLGenerator","type":"->","args":["theming.theming.getBackground"]},{"file":"/srv/www/htdocs/server/apps/theming/lib/Themes/DarkTheme.php","line":52,"function":"getCSSVariables","class":"OCA\\Theming\\Themes\\DefaultTheme","type":"->","args":[]},{"file":"/srv/www/htdocs/server/apps/theming/lib/Themes/DarkHighContrastTheme.php","line":55,"function":"getCSSVariables","class":"OCA\\Theming\\Themes\\DarkTheme","type":"->","args":[]},{"file":"/srv/www/htdocs/server/apps/theming/lib/Controller/ThemingController.php","line":324,"function":"getCSSVariables","class":"OCA\\Theming\\Themes\\DarkHighContrastTheme","type":"->","args":[]},{"file":"/srv/www/htdocs/server/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getThemeStylesheet","class":"OCA\\Theming\\Controller\\ThemingController","type":"->","args":["dark-highcontrast",false,false]},{"file":"/srv/www/htdocs/server/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Theming\\Controller\\ThemingController"},"getThemeStylesheet"]},{"file":"/srv/www/htdocs/server/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Theming\\Controller\\ThemingController"},"getThemeStylesheet"]},{"file":"/srv/www/htdocs/server/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Theming\\Controller\\ThemingController","getThemeStylesheet",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["dark-highcontrast","theming.Theming.getThemeStylesheet"]]},{"file":"/srv/www/htdocs/server/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/theming/theme/dark-highcontrast.css"]},{"file":"/srv/www/htdocs/server/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/srv/www/htdocs/server/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":143,"message":"Unable to generate a URL for the named route \"theming.theming.getBackground\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"theming.theming.getBackground\" as such route does not exist."}}


### Additional info

_No response_
PVince81 commented 2 years ago

It seems to be related to EXIF. Here is the non-working file:

wald-blätter

if I strip all exif with exiftool -all= wald-blätter.jpg the file will work

there's nothing in the logs about this

PVince81 commented 2 years ago

very strange, with the broken file, locally it fails on https://github.com/nextcloud/server/blob/stable25/apps/theming/lib/Themes/DefaultTheme.php#L248 because it doesn't find the route theming.theming.getBackground.

when inspecting the routes I found that the correct name is theming.userTheme.getBackground. when I replace this, it works even with the "broken" image

I retried also with the stripped file and now it's not working any more at all, so probably not EXIF. Or maybe the theme manager is somehow managing to cache the image in the browser without going to the above error.

Anyway, reading the code, the controller name is UserThemeController so the route has to be called userTheme. I'll adjust this

PVince81 commented 2 years ago

Fix is here: https://github.com/nextcloud/server/pull/34212