-
-
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
Php serializer was not serializing arrays by default. #6155
Conversation
This seems to fix the issue #6137 for WP-Piwik but I now get error on the visitor map inside Piwik itself (see below). Could this be a problem with the visitor map?
|
I can confirm this. Fixes WP-Piwik issue, but breaks visitor map. Warning: Illegal string offset 'metrics' in /var/www/piwik/plugins/UserCountryMap/Controller.php on line 226 Backtrace --> #0 Piwik\Error::errorHandler(...) called at [/var/www/piwik/plugins/UserCountryMap/Controller.php:226] [...] |
I've update the pull request to correct UserCountryMap:
If you look at the format section of the Reporting API Reference, it clearly states that PHP should return serialized data by default so I continue to believe that this is the appropriate change and that any function assuming otherwise was updated in error. |
Can confirm this fixes the map issue 👍 |
It's very hard to trace because the logical flow was reordered during a refactor. In both original and revised, getResponse() calls handleArray(). In the old version,
By default, caseRendererPHPSerialize() returns true
In the revised code,
While the PHP version of renderDataTable() also defaults to false in this particular commit:
it was later corrected:
If arrays were still routed through |
Thanks for the report & analysis @claytondaley
Probably it was changed by mistake, maybe we didn't have tests for this use case. Because this is an API breaking change, it should have been documented in the Platform changelog: http://developer.piwik.org/changelog @tsteur maybe you have some idea about this one? |
Don't think it was on purpose. It would have been documented otherwise. Tests were very likely not covering this. |
Thanks for the fix. I'll check if tests pass and will add an integration test case for |
Php serializer was not serializing arrays by default.
Fixes #6137