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
Display a footer message below Custom Variables report which explains why some metrics are not set #9643
Conversation
… are not set Goal: minimise user confusion and support requests. The message is only displayed when the report table contains Custom Variable of scope 'page'. If the report only contains Custom Variable of scope 'visit' the message won't be shown. Fixes #8128
Piwik::translate('General_And'), | ||
Piwik::translate('General_ColumnNbUsers') | ||
); | ||
$messageStart = Piwik::translate('Note: %s metrics are available for Custom Variables of scope \'visit\' only.', $metrics); |
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.
Shouldn't a translation key be specified?
Thanks, feedback is applied @tsteur |
Display a footer message below Custom Variables report which explains why some metrics are not set
@@ -34,5 +35,40 @@ public function configureView(ViewDataTable $view) | |||
$view->config->addTranslation('label', Piwik::translate('CustomVariables_ColumnCustomVariableName')); | |||
$view->requestConfig->filter_sort_column = 'nb_actions'; | |||
$view->requestConfig->filter_sort_order = 'desc'; | |||
|
|||
$view->config->filters[] = function (DataTable $table) use ($view) { | |||
if($this->isReportContainsUnsetVisitsColumns($table)) { |
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.
This fails on PHP 5.3 see eg http://builds-artifacts.piwik.org/piwik/piwik/9649/17844/PivotByDimension_pivoted_columns_report . Instead we need to use use ($view, $self)
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.
Just noticed it was already fixed in master
Goal: minimise user confusion and support requests.
The message is only displayed when the report table contains Custom Variable of scope 'page'.
If the report only contains Custom Variable of scope 'visit' the message won't be shown.
Fixes #8128