Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion system/services/email/EmailTemplateService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,8 @@ component {
, template
, viewOnline
) {
var cacheKey = ( $helpers.isTrue( arguments.useDefaultContent ?: "" ) ? "default" : "saved" ) & "rawhtml" & arguments.template;
var siteId = $getRequestContext().getSiteId() ?: "";
var cacheKey = siteId & ( $helpers.isTrue( arguments.useDefaultContent ?: "" ) ? "default" : "saved" ) & "rawhtml" & arguments.template;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache invalidation key mismatch after siteId prefix addition

Medium Severity

The cache key in _prepareHtml now includes a siteId prefix (e.g., {siteId}savedrawhtml{template}), but the cache invalidation in saveTemplate at line 391 still uses the old key format without the prefix (savedrawhtml{id}). This means _getTemplateCache().clear() will attempt to clear a non-existent key, leaving stale cached templates that won't be cleared when templates are updated.

Additional Locations (1)

Fix in Cursor Fix in Web

var fromCache = _getTemplateCache().get( cacheKey );

if ( !IsNull( local.fromCache ) ) {
Expand Down