Boolean fields used in Query Builder cause queries to fail

Wappler Version : 3.9.2
Operating System : Windows 10
Server Model: PHP
Database Type: MySQL
Hosting Type: custom

Expected behavior

What do you think should happen?

Having defined a column as tinyint, it should be possible to include this column in a query - eg with a condition such tinyintColumn = 1

Actual behavior

What actually happens?

Having enter ‘1’ in the query condition, Wappler converts this to ‘true’ and the query fails.

How to reproduce

Create a column and define it as Boolean (using Wappler’s Database Manager) or as a tinyint (eg in Navicat). The result is the same in either case. Include the column in a query, comparing the value to 1. Wappler converts this to ‘true’ and the query will fail. Wappler seems to treat the field as a text field.

This issue has been raised quite a few times. Although some changes/fixes have been made, the issue seems the same as raised here in v.3.7.8. (I think it was working in some versions since then.)

There are various ways round this, eg editing the code and changing ‘true’ to ‘1’:

image
… but Wappler will change this back if the Save button is used (not with Ctrl+S), or if the SA is edited.

Community Page
Last updated: