Log message #4222927

# At Username Text
# Jan 18th 2020, 20:57 wizardfix Ha! Was looking at that page before... Yeah I see the reference: > `BOOL`, `BOOLEAN` > These types are synonyms for `TINYINT(1)`. A value of zero is considered false. Nonzero values are considered true: but I find it unintuitive.
# Jan 18th 2020, 20:49 ndm boolean is a synonym for tinyint(1)
# Jan 18th 2020, 20:49 ndm https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html
# Jan 18th 2020, 20:45 wizardfix @jimbo2150 @admad I can find *nothing at all* in the MySQL docs saying `TINTINT(1)` is treated as a Boolean. And in my phpMyAdmin, it lets me change a field to Boolean, and generates this SQL statement: ```ALTER TABLE `results` CHANGE `status` `status` BOOLEAN UNSIGNED NULL DEFAULT TRUE;``` thus seeming to support Booleans... I'm trying to understand this! :)
# Jan 18th 2020, 20:01 wizardfix so logically I expected `TINYINT(1)` to be able to store any integer in `[0, 1, 2, ... ,8, 9]`...
# Jan 18th 2020, 19:57 ndm Ackchyually the number in parentheses _is_ the display width. The number of bytes an integer type can store is defined by the type of the integer, ie tinyint, smallint, mediumint, int, bigint
# Jan 18th 2020, 19:52 wizardfix Ha! The :bug: was in my understanding of MySQL! x) So I've learnt something and got my method working. Win-win! :)
# Jan 18th 2020, 19:51 jimbo2150 The number in the parentheses is the maximum number of bytes stored in the field, not the number of characters.
# Jan 18th 2020, 19:49 admad tinyint(1) is the only way to emulate boolean in mysql since it's lacks "real" boolean type like other dbs
# Jan 18th 2020, 19:36 wizardfix @jimbo2150 thanks but u=is
# Jan 18th 2020, 19:34 jimbo2150 @wizardfix In MySQL, `BOOLEAN` is a synonym for `TINYINT(1)`. Your options are to set it to `TINYINT(2)` or overwrite the column type in CakePHP 3+: https://stackoverflow.com/questions/10801632/cakephp-and-tinyint-as-boolean
# Jan 18th 2020, 19:17 lpj145 what your think about repository pattern on cakephp ?
# Jan 18th 2020, 19:16 lpj145 guy's, i hope your are so fine...
# Jan 18th 2020, 19:16 wizardfix Is this a bug? Spent hours with my brain frying wondering why Cake 3.8 refused to update a row in my database. Eventually realised it was treating my `TINYINT(1) UNSIGNED DEFAULT 1` field as a Boolean. The moment I changed it to `TINYINT(2)` everything worked. :thinking_face:
# Jan 18th 2020, 02:24 markstory @neon1024 I’m actually working on making debug() better, and enable better formatting for CLI and HTML output. JSON is tricky though as you can’t really output more than one ‘thing’
# Jan 17th 2020, 13:40 storkovo and the hell of loop errors is gone
# Jan 17th 2020, 13:34 admad you will get json response for exceptions, not for errors
# Jan 17th 2020, 13:29 neon1024 I thought Exception Renderer too, guess I need to build one
# Jan 17th 2020, 13:28 neon1024 So what the content-type is becomes irrelevant
# Jan 17th 2020, 13:28 neon1024 I think the error handler is spitting this out before the response is composed
# Jan 17th 2020, 13:28 neon1024 As the response type is correct
# Jan 17th 2020, 13:28 neon1024 I think there is an issue with the api
# Jan 17th 2020, 13:28 spriz Yeah but it looks good now, doesn't it? ;P
# Jan 17th 2020, 13:27 neon1024 @spriz Preview shows HTML as well
# Jan 17th 2020, 13:18 spriz but I've done it with an exceptionRenderer
# Jan 17th 2020, 13:17 spriz @neon1024 Change the tab to `preview` and it's good ;P
# Jan 17th 2020, 12:18 neon1024 …so that errors are more readable than this
# Jan 17th 2020, 12:18 neon1024 Anyone know if there is a simple way to have requests sent as application/json throw errors as json?
# Jan 17th 2020, 12:04 challgren Well first is your flash even working?
# Jan 17th 2020, 11:57 challgren like bootstrap-ui?
# Jan 17th 2020, 11:56 challgren Do you have anything override the flashhelper?
# Jan 17th 2020, 11:56 alexdd55976 nope... no changes.
# Jan 17th 2020, 11:54 dereuromark ctp => php as well for cake4
# Jan 17th 2020, 11:53 alexdd55976 @challgren this is what i looked into
# Jan 17th 2020, 11:52 alexdd55976 @javier.villanueva nope nothing.
# Jan 17th 2020, 11:10 challgren I think it would be in /templates/element/flash https://github.com/cakephp/app/tree/master/templates/element/flash
# Jan 17th 2020, 11:04 javier.villanueva Because if you have any plugin that override Elements/Flash folder
# Jan 17th 2020, 11:02 javier.villanueva Do you use any template?
# Jan 17th 2020, 10:10 alexdd55976 thats right
# Jan 17th 2020, 10:09 neon1024 Perhaps you’re in 4.x?
# Jan 17th 2020, 10:07 alexdd55976 @neon1024 > Should be in the Elements/Flash folder > Then the Flash->success() would use success.ctp