Exception Updating Block With MariaDB 10.2.2

Permalink Browser Info Environment
Since upgrading our server to MariaDB 10.2.2 we have seen SQL Exceptions raised when editing the block. MaraiDB is rather fussy in its default configuration, and complains when incorrect data is pushed into various fields. We get exceptions like this:

'UPDATE btD3RandomImage SET bID = ?, fsID = ?, max_width = ?, max_height = ?, do_crop = ? WHERE bID = ?'
with params ["9286", "27", "1000", "667", false, "9286"]:
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `totalsto_c5`.`btD3RandomImage`.`do_crop` at row 1

This is because MariaDB has an sql_mode that includes STRICT_TRANS_TABLES, which prohibits boolean false from being saved into an integer field.

The fix I have added to the block controller save() method simply replaces:

$args['do_crop'] = ($args['do_crop']) ? true : false;


with

$args['do_crop'] = ($args['do_crop']) ? 1 : 0;

Type: Pre-Sale
Status: Resolved
jero
View Replies:
A3020 replied on at Permalink Reply
A3020
Hi, thanks for your report. I'm not using this add-on myself, so I wasn't aware of this. I've submitted a new version. Thanks again!

concrete5 Environment Information

MariadDB 10.2.2

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.