Skip to content
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

Updating pdf report with emailMe=0 throws SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'email_me' at row 1 #2360

Closed
julienmoumne opened this issue Apr 25, 2011 · 7 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@julienmoumne
Copy link
Member

On Windows 7x64, PHP 5.3.5, MySQL 5.5.9 x64, updating a pdf report with emailMe=0 fails and gives :

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'email_me' at row 1

The problem seems to be located at plugins/PDFReports/API.php#L105.

In the API call, when

  • emailMe=false, (bool)$emailMe is equal to true (no SQL error is thrown)
  • emailMe=0, (bool)$emailMe is equal to false (a SQL error is thrown)
  • emailMe=true, (bool)$emailMe is equal to true (no SQL error is thrown)
  • emailMe=1, (bool)$emailMe is equal to true (no SQL error is thrown)

When using the PDFReport UI and unticking the email me checkbox, the request to the API is made with emailMe=0 and displays the SQL error. Same is true for plugins/PDFReports/tests/PDFReports.test.php#L131

@julienmoumne
Copy link
Member Author

It seems to be related to http://framework.zend.com/issues/browse/ZF-1457

@robocoder
Copy link
Contributor

isn't the first case also a problem?

Does Snover's July '09 patch work? (We won't be upgrading to ZF2 because it requires php 5.3 features.)

@julienmoumne
Copy link
Member Author

(In [4549]) refs #2360

@julienmoumne
Copy link
Member Author

The patch for Zend Framework does work but not in all cases.

When an insert statement is cached core/Db/Adapter/Pdo/Mysql.php#L182, it does not go through core/Db/Adapter/Pdo/Mysql.php#L193, hence, doesn't go through libs/Zend/Db/Adapter/Pdo/Abstract.php#L228 where the patch is applied.

@mattab
Copy link
Member

mattab commented Apr 26, 2011

(In [4551]) Refs #2360 does this fix it Julien? on my box it works before so I cant tell

@julienmoumne
Copy link
Member Author

This patch works. Shouldn't this be done in a more generic way ?

Also, (int)'true' equals 0, but I guess it's ok.

@mattab
Copy link
Member

mattab commented Apr 26, 2011

It should, but if the bug is in Zend there is not much we can do appart from submitting them the patch ;-)

@julienmoumne julienmoumne added this to the 1.4 - Piwik 1.4 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants