Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent notifications aren't removed. Make Error while creating/copying file to warning dismissable #15575

Closed
Findus23 opened this issue Feb 16, 2020 · 7 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@Findus23
Copy link
Member

quite low priority, but I wanted to write it down just in case I stumble across it again in the future.
(and maybe the same is true for other error messages and it confuses user)

When developing Matomo doesn't have write permission to plugins/. This doesn't matter as it isn't needed for things apart from the marketplace.

When one tries to download something from the marketplace this error message appears rightfully:

grafik

The issue is that there is no way to get rid of the notification. Pressing the x only closes it with JS, but as it is rendered by Twig it will reappear on every page even when it doesn't matter anymore.

Adding a static::$session->unsetAll(); to

private static function getSession()
{
if (!isset(static::$session)) {
static::$session = new SessionNamespace('notification');
}
if (empty(static::$session->notifications) && self::isSessionEnabled()) {
static::$session->notifications = array();
}
return static::$session;
}

removes it from the session and gets finally rid of the message (ending the session in another way would also work).

@Findus23 Findus23 added the c: Usability For issues that let users achieve a defined goal more effectively or efficiently. label Feb 16, 2020
@sgiehl
Copy link
Member

sgiehl commented Feb 25, 2020

maybe related to #15498

@Findus23
Copy link
Member Author

@sgiehl That sounds like the same general issue (notifications in the session don't disappear)

@tsteur tsteur added this to the Backlog (Help wanted) milestone Feb 25, 2020
@Findus23 Findus23 added the Bug For errors / faults / flaws / inconsistencies etc. label Apr 20, 2020
@Findus23
Copy link
Member Author

#12934 is also caused by the same issue.

@tsteur tsteur changed the title make Error while creating/copying file to warning dismissable Persistent notifications aren't removed. Make Error while creating/copying file to warning dismissable Apr 20, 2021
@tsteur tsteur added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Apr 20, 2021
@tsteur
Copy link
Member

tsteur commented Apr 20, 2021

To fix this problem we want to fix the generic problem that a persistent notification only seems to disappear when logging out and logging in.

You can reproduce this by applying this change

diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php
index 4619ecca9f..11f10a1ac6 100644
--- a/plugins/CorePluginsAdmin/PluginInstaller.php
+++ b/plugins/CorePluginsAdmin/PluginInstaller.php
@@ -52,6 +52,7 @@ class PluginInstaller
 
     public function installOrUpdatePluginFromMarketplace($pluginName)
     {
+        throw new \Exception('foo');
         $this->checkMarketplaceIsEnabled();
 
         $this->pluginName = $pluginName;

Then go to marketplace, and try to install a plugin. Then go back for example to the marketplace page or the Platform -> API page in the Matomo admin.

The notification will always appear again, even if you click on the "x". It seems it is supposed to call a method CoreHome controller markNotificationAsRead action when clicking on the "x" and then not appear anymore. However, it doesn't look like the notification angular component is actually sending that request maybe.

@tsteur tsteur modified the milestones: Backlog (Help wanted), 4.4.0 Apr 20, 2021
@tsteur
Copy link
Member

tsteur commented Apr 20, 2021

image
problem is there's no notificationId defined in the angularjs component. It's likely only set in the scope.

@tsteur
Copy link
Member

tsteur commented Jun 9, 2021

@sgiehl is this one already done maybe?

@sgiehl
Copy link
Member

sgiehl commented Jun 10, 2021

Yes. That was actually already fixed with 4.3.0

@sgiehl sgiehl closed this as completed Jun 10, 2021
@sgiehl sgiehl modified the milestones: 4.5.0, 4.3.0 Jun 10, 2021
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

4 participants