Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
It hit the bonk screen everytime click on "save" when run in Mysql strict mode
chanh
✭✭
This is the screen I got every time I click on "save" when run in Mysql strict mode.
Something has gone wrong.
We've run into a problem and are unable to handle this request right now.
Please check back in a little while.
I suspect due to this value here but not sure how to go about fixing it.
->Column('RawBody', 'tinyint(1)', 0)
->Column('SiteMenuLink', 'tinyint(1)', 0)
This set the colume to "NOT NULL" and have a default value of '0' but in the code whenever it "save" a page, this two fields are blank when it is not click on the check box thus cause a "bonk"
What do you think?
0
Comments
As far as I know, Vanilla doesn't work very well with MySQL in strict mode (see previous discussion).
Surely there must be a way to fix it, but I suspect that it will require a good deal of fiddling with the core files, which may not always be a good idea as changes would get lost when updates are applied.
My shop | About Me
I added these line before the "Save" and it seems to work with MySql strict mode.
What do you think about these fixes?
Thanks
The fixes look okay and I might add it in a future release. Thanks!
MySQL strict mode expects data to match up with each column's data type, so using strict mode introduces some advantages, but it depends on the application.
Presume that a column expects an integral data type and a program wants to pass in a 1. You should pass in the actual integer
1
instead of the string'1'
. Also, MySQL does not have a real boolean data type dealing with values offalse
andtrue
, so if you pass in the PHP boolean valuetrue
in a SQL query, the PHP database driver being used or MySQL probably has a procedure coded in to automatically convert it to1
. I do not recall if strict mode would show a warning about these kinds of things.After all, some PHP programs do not work well with MySQL in strict mode because PHP is a dynamically typed language. Automatic casts to types programmers do not expect happen a lot.
Add Pages to Vanilla with the Basic Pages app
Or you can just typecast:
Avoiding an ugly chain of
if
statements.My shop | About Me
Sound good! Thanks