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
Convert comma separated param values to arrays if needed #12796
Conversation
if (is_array($defaultValue)) { | ||
$value = Piwik::getArrayFromApiParameter($value); | ||
} | ||
return $value; |
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.
Will this affect other parameters as well? Eg, the 'label' parameter or a parameter like it might have commas in it but might not be an array.
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.
it shouldn't, as those parameters should not have an array as default value.
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.
Ah, I see, nvm then.
LGTM. Do you think it would be worthwhile to mention this change in the changelog? That plugins that add overridable array ViewDataTable properties can now accept comma separated lists from query parameters? Although I originally remember this being supported by columns_to_display, so maybe it's more of a regression. |
|
Right, maybe I'm thinking about |
I reckon it's not needed to mention it in this case |
fixes #12627