Show an error message in case we deactivate a plugin because of missing dependencies #9676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refs #4485
See #4485 (comment) we may silently disable / deactivate plugins in case the requirements of a plugin are no longer met. In this case we do now simply output a trivial error message by triggering a notification.
The notification may or may not be seen depending on if the plugin was disabled automatically while a UI page was requested. Also it may be printed to any user, or anonymous user. However this is rather very unlikely. Problem is we do not know at the time of checking for these conditions whether someone is logged in etc. Also sessions won't be started at that time so we cannot persist it under circumstances.
Initially it was not possible to trigger a notification there at all since the session was not loaded at that time of bootstrapping Piwik. I changed the notification manager to only store persistent notifications in session from now on since all others don't need to be stored there (non persistent notifications get deleted at some point anyway). Also in case a session becomes available later, there is a chance that we may copy a notification from the local cache into the session to make sure it will be displayed in the UI.
We also make sure notifications are stored in sessions.