30K
May 19, 2021, 3:11pm
1
Hello there,
Unfortunately, I’ve needed to create an account here and ask for help as I couldn’t solve this issue even after extensive research.
When I try to upload a Logo, the following happens:
A POST request is initiated: XXX.index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo
Just as expected, but then I immediately get thrown off to the Login screen with the following error message:
Error : Token is not valid.
See screenshot here:
Since I can’t get the upload to work, I posted my logo manually in the misc/user/ folder, and although the favicon worked after manually uploading, the logo does not. This is what’s really throwing me off.
Also, the Logo is shown in the settings (where you can choose the file to upload), but Matomo is not using it (in the navbar and stuff), but again the favicon works ok.
Any Ideas?
Lukas
(Lukas Winkler)
May 20, 2021, 9:37am
2
Hi,
This has been reported in
opened 10:44PM - 18 May 21 UTC
closed 08:16AM - 19 May 21 UTC
Bug
Regression
Fresh installation of Matomo 4.3, i tried to upload a logo, got kicked out to th… e login page with an error saying ""Error: Token is not valid."
Trying to log back in while on this page keeps failing.
Note that the url is `index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo`
## Expected Behavior
The logo should upload.
## Current Behavior
The user get's kicked out and can't get back in unless manually changing the url.
## Steps to Reproduce (for Bugs)
1. Fresh install
2. click on the "Upload your logo" link in the "Become a Motomo expert" box on the dashboard
3. Scroll down to the branding settings, select a logo.
## Your Environment
* Matomo Version: 4.3
* PHP Version: 8.0.5
* Server Operating System: Ubuntu 16.04.4
* Additionally installed plugins:
Nothing, brand new installation
* Browser: Chrome
* Operating System: Mac OS
If you don’t want to wait for the next patch release, you can apply the fix yourself:
matomo-org:4.x-dev
← matomo-org:w17586
opened 11:40PM - 18 May 21 UTC
### Description:
fixes #17586
### Review
* [x] Functional review done
…
* [x] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
* [x] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
* [x] Security review done [see checklist](https://developer.matomo.org/guides/security-in-piwik#checklist)
* [x] Code review done
* [x] Tests were added if useful/possible
* [x] Reviewed for breaking changes
* [x] Developer changelog updated if needed
* [x] Documentation added if needed
* [x] Existing documentation updated if needed
diff --git a/plugins/CoreAdminHome/templates/generalSettings.twig b/plugins/CoreAdminHome/templates/generalSettings.twig
index 84d7b52a411..f070cc97f14 100644
--- a/plugins/CoreAdminHome/templates/generalSettings.twig
+++ b/plugins/CoreAdminHome/templates/generalSettings.twig
@@ -182,6 +182,7 @@
<form id="logoUploadForm" method="post" enctype="multipart/form-data" action="index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo">
{% if fileUploadEnabled %}
<input type="hidden" name="token_auth" value="{{ token_auth }}"/>
+ <input type="hidden" name="force_api_session" value="1"/>
{% if logosWriteable %}
<div class="alert alert-warning uploaderror" style="display:none;">