Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit ee6e202

Browse files
bpamiriclaude
andcommitted
Use quoted string booleans in ORM WHERE clauses for CockroachDB
Wheels ORM cfqueryparam layer cannot parse unquoted true/false in WHERE clauses. Changed to quoted 'true'/'false' strings which PostgreSQL and CockroachDB accept as valid boolean input and Wheels can parameterize. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0d4ccfe commit ee6e202

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

app/controllers/admin/AdminController.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ component extends="app.Controllers.Controller" {
381381
}
382382
try {
383383
blog.statusId = 7;
384-
blog.is_deleted = true;
384+
blog.is_deleted = 'true';
385385
blog.deletedAt = now();
386386
blog.deletedBy = GetSignedInUserId();
387387
blog.save();

app/controllers/admin/UserController.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ component extends="app.Controllers.Controller" {
215215
* Count active users
216216
*/
217217
private function countActive() {
218-
return model("User").count(where="status = true");
218+
return model("User").count(where="status = 'true'");
219219
}
220220

221221
/**
222222
* Count pending users
223223
*/
224224
private function countPending() {
225-
return model("User").count(where="status = false");
225+
return model("User").count(where="status = 'false'");
226226
}
227227

228228
/**

app/controllers/web/AuthController.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ component extends="app.Controllers.Controller" {
797797

798798
try {
799799
// Check if user already has a verification token
800-
var existingToken = model("UserToken").findOne(where="user_id='#user.id#' AND status=false");
800+
var existingToken = model("UserToken").findOne(where="user_id='#user.id#' AND status='false'");
801801

802802
if (!isObject(existingToken)) {
803803
// Generate a new verification token

app/controllers/web/BlogController.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ component extends="app.Controllers.Controller" {
744744
public function commentsFeed() {
745745
// Get recent comments with related blog post
746746
comments = model("Comment").findAll(
747-
where = "isPublished = true",
747+
where = "isPublished = 'true'",
748748
include = "Blog",
749749
order = "createdAt DESC",
750750
limit = 20,
@@ -1250,7 +1250,7 @@ component extends="app.Controllers.Controller" {
12501250
}
12511251

12521252
function getAllCommentsByBlogid(required numeric id) {
1253-
var comments = model("Comment").findAll(include="User", where="isPublished = true AND blogid = '#arguments.id#' AND commentParentId ISNULL ", cache=5);
1253+
var comments = model("Comment").findAll(include="User", where="isPublished = 'true' AND blogid = '#arguments.id#' AND commentParentId ISNULL ", cache=5);
12541254

12551255
return comments;
12561256
}
@@ -1300,7 +1300,7 @@ component extends="app.Controllers.Controller" {
13001300
response = saveComment(params);
13011301
}
13021302
if(structKeyExists(response, "Id")){
1303-
comments = commentModel.findAll(include="User", where="id ='#response.Id#' AND isPublished = true");
1303+
comments = commentModel.findAll(include="User", where="id ='#response.Id#' AND isPublished = 'true'");
13041304
renderPartial(partial="partials/comment");
13051305
}
13061306
} catch (any e) {

app/controllers/web/TestimonialController.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ component extends="app.Controllers.Controller" {
1313
*/
1414
public void function publicList() {
1515
testimonials = model("Testimonial").findAll(
16-
where="isApproved = true",
16+
where="isApproved = 'true'",
1717
include="User",
1818
order="createdAt DESC"
1919
);

app/models/Comment.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ component extends="app.Models.Model" {
3030

3131
// fetch all comments
3232
public function getAllComments(){
33-
var comments = findAll(where='isPublished = true', include="User");
33+
var comments = findAll(where="isPublished = 'true'", include="User");
3434
return comments;
3535
}
3636
}

app/models/Testimonial.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ component extends="app.Models.Model" {
5050

5151
mergedOptions.append(options, true);
5252

53-
conditions = "isApproved = true AND displayPermission = true";
53+
conditions = "isApproved = 'true' AND displayPermission = 'true'";
5454
if (mergedOptions.onlyFeatured) {
55-
conditions &= " AND isFeatured = true";
55+
conditions &= " AND isFeatured = 'true'";
5656
}
5757

5858
return model("Testimonial").findAll(

0 commit comments

Comments
 (0)