diff --git a/system/services/email/EmailTemplateService.cfc b/system/services/email/EmailTemplateService.cfc index dbd2927402..1ca2f44a67 100644 --- a/system/services/email/EmailTemplateService.cfc +++ b/system/services/email/EmailTemplateService.cfc @@ -692,7 +692,13 @@ component { * @markAsSent.hint Whether or not to mark a 'fixedschedule' template as sent */ public string function updateScheduledSendFields( required string templateId, boolean markAsSent=false ) { - var template = getTemplate( id=arguments.templateId, allowDrafts=true, fromVersionTable=false ); + var template = getTemplate( + id = arguments.templateId + , allowDrafts = true + , fromVersionTable = false + , useRequestCache = false + ); + var updatedData = { schedule_next_send_date = "" }; if ( template.sending_method == "scheduled" ) { diff --git a/tests/unit/api/email/EmailTemplateServiceTest.cfc b/tests/unit/api/email/EmailTemplateServiceTest.cfc index 94aaea6058..21fb6b1b04 100755 --- a/tests/unit/api/email/EmailTemplateServiceTest.cfc +++ b/tests/unit/api/email/EmailTemplateServiceTest.cfc @@ -188,7 +188,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_sent = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate").$args( template=template, id=templateId , isDraft=true ).$results( templateId ); service.$( "_getNow", nowish ); @@ -215,7 +215,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -245,7 +245,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -272,7 +272,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = DateAdd( "ww", -1, nowish ) }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -299,7 +299,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = nowish }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -325,7 +325,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = DateAdd( "ww", 4, nowish ) }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -353,7 +353,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = nextSendDate }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -379,7 +379,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = DateAdd( "ww", 4, nowish ) }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -406,7 +406,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -433,7 +433,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -461,7 +461,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -496,7 +496,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -526,7 +526,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_next_send_date = "" }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish ); @@ -553,7 +553,7 @@ component extends="resources.HelperObjects.PresideBddTestCase" { , schedule_sent = true }; - service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false ).$results( template ); + service.$( "getTemplate" ).$args( id=templateId, allowDrafts=true, fromVersionTable=false, useRequestCache=false ).$results( template ); service.$( "saveTemplate", templateId ); service.$( "_getNow", nowish );