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

Commit 0b9fd69

Browse files
committed
Prevent publishedAt from being updated on blog edit
1 parent e7d7b69 commit 0b9fd69

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

app/controllers/Controller.cfc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ component extends="wheels.Controller" {
399399
} else if (isUserAdmin()) {
400400
params.statusId = 2;
401401
params.status = "Approved";
402-
params.publishedAt = now();
402+
// Do NOT set publishedAt on update
403403
} else {
404404
params.statusId = 2;
405405
}
@@ -421,9 +421,7 @@ component extends="wheels.Controller" {
421421
if (structKeyExists(params, "status")) {
422422
blog.status = params.status;
423423
}
424-
if (structKeyExists(params, "publishedAt") && len(trim(params.publishedAt))) {
425-
blog.publishedAt = params.publishedAt;
426-
}
424+
// Only update publishedAt if this is a creation, not update
427425
if (structKeyExists(params, "postTypeId")) {
428426
blog.postTypeId = params.postTypeId;
429427
}

0 commit comments

Comments
 (0)