Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[BUG]: Model - Update - Postgres Bool False/True Not Working Phalcon 4 [temp fix at the end] #14722
When I try to save a boolean value on postgresql, it does not save;
$model->getMessages() "return field1,field2,field3.... is required
Do not work If I use true/false
Do not Work
Throw required field allowed and enabled
Do not Work If i want to change the value or auto update the column;
Work On Create
Return values empty on object after create.
they came with boolean type if i do a $resultset->toArray();
Same result as before.
I didn't updated this 2 fields, they are filled, but ask again, and if i try
This is fine.
So always when i want to update a record i have to pass all boolean columns as int again, even if they are already filledup, phalcon does not accept to save bool,
How i have to do to update a record on database or save.
id: (boolean) true
And on cache metadata if enabled,
@ruudboon Worked if i go to meta-app_models_model.php and removed from int type
If i disable models metadata does not work, so the problem isn't on cache, is on the field Type = numeric
Fix for who has the same problem, must use cache on model metadata.
Using this, does not bring on metadata as numeric field.
Thank you @ruudboon i'm using about 7 years phalcon, i will as help as i can.
But i found the problem, and fix here for me, and is describe below how to fix for who use postgresql
Tinyint is already treated on Line 248
So the fix, extends PDO, and change describeColumns.
Do not set column as numeric, or will come back to the same problem
Just use it only phalcon team does not fix, after they did come back to original
Service should look like something...
Before F5 and reload to test, clear metadata folder(if use it).
And now you can use again true/false or update a row without passing all values(boolean) again as int.
Why the problem does not occur on phalcon 3.4 @ruudboon .
No numeric type is set for smallint(tinyint) or boolean