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
json_encode error when pivoting event widget #6364
Comments
Thanks for the report! What version of PHP are you using? |
@mattab PHP 5.3.2, it's mentioned in the forum post. |
@nikolas can you upgrade to more recent PHP ? I expect this bug is due to a bug in PHP 5.3.2. Thanks |
@mattab no I can't, I don't control the servers that run this version of PHP. |
@mattab If you're closing this as "wontfix", please change the requirements on the README, currently they say piwik supports "PHP 5.3.2 or greater" |
hundreds of users run it with 5.3.2 and it mostly works. just some features like this may be broken because of bugs in PHP... we can't really increase requirements and block piwik from used by user because of this bug that is triggered in very particular use case. though I agree it's annoying and frustrating for you and i'm sorry about that. Maybe ask your host as often they are able to upgrade php |
I'm not sure if that is really a 5.3.2 failure. Might be possible that the data given to json_decode in that case just is invalid. Could you maybe try to log the data given to json_decode? |
@sgiehl It appears to be the decoded |
Maybe you can get it from their git: http://git.php.net/?p=php-src.git;a=commit;h=79061d969e948271722cedb2636de0f986ff5250 |
@sgiehl Thanks! I'll do some testing just as soon as I'm done building 5.6 |
I know it's off topic but +1 for mentioning PHP 5.3.3 requirement (and also checking for it in update-check) in case we do not fully support it as this is very annoying otherwise |
@nikolas Could you maybe temporarily try it on PHP > 5.3.2 ? it would be nice to double check that this bug is indeed a bug in 5.3.2 implementation of JSON. |
I created an ec2 instance using ubuntu 10.04 and can confirm the issue is w/ the code |
OK we will increase Piwik PHP requirement to PHP 5.3.3: #6390 |
Hi, sorry for not catching up on time (I posted my report in the forum thread above, too). FIRST error i get is: (maybe unrelated)
After changing the date range to anything else via the date range widget, the actual pivot error is back again:
I propose reopening this issue |
… encoding. Will avoid php warning given on some PHP 5.3 builds for json_encode-ing decoded entities.
I committed a change that should fix this issue 5.3.* versions that experience the bug. |
Thanks! I'll check if the next version can cope with the forward slashed in our event values |
Note: if you'd like to check sooner, you can replace the core/DataTable/Filter/PivotByDimension.php file with this one: https://raw.githubusercontent.com/piwik/piwik/ebc7d6c2f08d231c95a1aed04c7966c1acf927d3/core/DataTable/Filter/PivotByDimension.php |
Hi @diosmosis, I applied your changed version - sorry to tell you that nothing changed. As the PivotByDimension Class doesn't appear in my stacktrace (above) that's explicable. |
Looks like a dumb mistake on my part, I added the code to the wrong part of the file, I'll apply another fix soon. |
…PHP. When decoding use UTF8 encoding so json_encode will not complain.
@nkuehn I've applied a correct fix to the PivotByDimension.php file. I tested on an ec2 instance setup with php 5.3.2 (via ubuntu 10.04), so this should work. You can apply it in the same manner as before. |
Hooray, it works! Thank you very much @diosmosis I still have that "Failed to get data from API: The date '2014-10-09' is not a correct date range" error, but that's probably a different issue. |
It was suggested on the Piwik forum that I open this issue here as well. http://forum.piwik.org/read.php?2,120372,120568
I get an error when I pivot the widget at the Action -> Event page. I can't undo the pivot because the widget won't respond to any mouse clicks, or delete this widget since I didn't create it in the first place. I'll have to revert the database from a backup. This is on Piwik 2.7.0., PHP 5.3.2.
If you run into this issue, the only way to get out of this state is to revert the database to a previous version, or run this SQL query:
DELETE FROM piwik_option WHERE option_name LIKE 'viewData%';
Here's the log:
http://dpaste.com/0MMY7AX
The text was updated successfully, but these errors were encountered: