-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Hide segments containing expressions from disabled plugins or features #21521
Conversation
Co-authored-by: Michal Kleiner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, failing tests are unrelated.
Let's see what @sgiehl thinks.
I had some thoughts around this topic. Did you consider the following scenario when creating/testing this PR: |
Archiving will catch the exception thrown when trying to initialize the warning and then skip the segment, nothing has changed there. For the UI, we're checking each segment against the current site before adding it to the segment selector, so if there is a globally available segment it will be checked for validity against the currently chosen site and only added to the site selector if it is valid. If the user then changes site the globally available segment will be checked again for the new site. |
Ok. So for hiding unavailable segments from the UI the approach works nicely. In terms of archiving we might need to do some more testing. I'll merge this PR already, as we can implement further changes in a new PR if needed. |
Description:
refs #21339
Fixes #21318
When an attempt is made to use a segment which contains expressions referencing a disabled dimension then the exception
Segment '$name' is not a supported segment.
is thrown.This can happen when a plugin is disabled or if certain features which provide segments are turned off, such as the visitor profile.
For the cron-based archiving process the exception is caught and a non-fatal info message is shown.
In the Matomo dashboard segments containing unavailable expressions can still be chosen in the segment selector and doing so will result in fatal errors as API calls to retrieve segment data will encounter the
Segment '$name' is not a supported segment.
error and return HTTP 500 codes.How to recreate
To recreate this issue try the following steps:
config.ini.php
Error: Segment 'visitorId' is not a supported segment.
What this PR does
This PR filters the list of segments shown in the segment selector to remove any segments which contain unavailable expressions. If the disabled plugin or feature is re-enabled then the segments will immediately be available again.
Integration tests are included which check availability of test segments for disabled visitor id, disabled user id and a disabled plugin segment.
Review