Skip to content

Commit

Permalink
Merge pull request #610 from Ortus-Solutions/update_variableScope_dvega
Browse files Browse the repository at this point in the history
Resolve CONTENTBOX-1511
  • Loading branch information
jclausen authored Jul 30, 2024
2 parents ae9e72e + a3b627a commit 559635b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/contentbox/models/system/SettingService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 :)
Expand All @@ -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 );
Expand Down

0 comments on commit 559635b

Please sign in to comment.