You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a MySQL database connection set to STRICT_TRANS_TABLE, the
database server won't accept the PHP true/false value, it refuses it with the
following error: "SQLSTATE[HY000]: General error: 1366 Incorrect integer value:
'' for column 'xy' at row 1".
The error originates from that PHP tries to pass the boolean value as a
PHP-boolean, but in MySQL such value doesn't exist. So it's necessary to simple
cast it to integer.
In the mapper's toArray() function (~56. line) I replaced the following:
'<?=$column['field']?>' => $model->get<?=$column['capital']?>(),
to:
<?php $typeCast = $column['phptype'] == 'boolean' ? ' (int)' : '';?>
'<?=$column['field']?>' =><?=$typeCast?> $model->get<?=$column['capital']?>(),
This patch works fine, but it doesn't handle other DB engines or when you need
boolean values in PHP code (aka. you need the toArray() function not for save
into the database).
Original issue reported on code.google.com by [email protected] on 20 Aug 2012 at 10:33
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 20 Aug 2012 at 10:33The text was updated successfully, but these errors were encountered: