It seems like this module is unable to filter using the ORM on boolean fields unless you pass an int to the filter.
This is the error that is triggered when passing a boolean:
SilverStripe\ORM\Connect\DatabaseException: Couldn't run query:
SELECT DISTINCT "LoginSession"."ClassName", "LoginSession"."LastEdited", "LoginSession"."Created", "LoginSession"."LastAccessed", "LoginSession"."IPAddress", "LoginSession"."UserAgent", "LoginSession"."Persistent", "LoginSession"."MemberID", "LoginSession"."ID",
CASE WHEN "LoginSession"."ClassName" IS NOT NULL THEN "LoginSession"."ClassName"
ELSE E'SilverStripe\\SessionManager\\Model\\LoginSession' END AS "RecordClassName"
FROM "LoginSession"
WHERE ("LoginSession"."LastAccessed" < $1)
AND ("LoginSession"."Persistent" = $2)
ORDER BY "LoginSession"."LastAccessed" DESC
ERROR: invalid input syntax for integer: ""
MyDataObject::get()->filter([
'MyBooleanDBField' => true
]);
Booleans can be used with ORM filtering.
Issue
It seems like this module is unable to filter using the ORM on boolean fields unless you pass an
intto the filter.This is the error that is triggered when passing a boolean:
Failing travis build: https://travis-ci.com/github/silverstripe/silverstripe-session-manager/jobs/482489500
Steps to Replicate
Expected Outcome
Booleans can be used with ORM filtering.
Version
2.3.1Related issues