From a3b627a0497e85671d3da69e65a5cfb4bed4e0d7 Mon Sep 17 00:00:00 2001 From: Davis Vega Date: Tue, 30 Jul 2024 09:14:27 -0600 Subject: [PATCH] I create a new variable to increase the scope of site ID --- modules/contentbox/models/system/SettingService.cfc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/contentbox/models/system/SettingService.cfc b/modules/contentbox/models/system/SettingService.cfc index c70fd3096..e6709a5ac 100755 --- a/modules/contentbox/models/system/SettingService.cfc +++ b/modules/contentbox/models/system/SettingService.cfc @@ -603,6 +603,7 @@ component */ SettingService function bulkSave( struct memento, site ){ var settings = isNull( arguments.site ) ? getAllSettings() : getAllSiteSettings( arguments.site.getSlug() ); + var siteId = arguments.site ?: javacast( "null", 0 ); var newSettings = []; arguments.memento @@ -614,7 +615,7 @@ component .each( function( key, value ){ var thisSetting = findWhere( { name : key, - site : !isNull( arguments.site ) ? arguments.site : javacast( "null", "" ) + site : !isNull( siteId ) ? siteId : javacast( "null", "" ) } ); // Maybe it's a new setting :) @@ -625,8 +626,8 @@ component thisSetting.setValue( toString( value ) ); // Site mapping - if ( !isNull( site ) ) { - thisSetting.setSite( site ); + if ( !isNull( siteId ) ) { + thisSetting.setSite( siteId ); } newSettings.append( thisSetting );