Skip to content

Commit

Permalink
I create a new variable to increase the scope of site ID
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVega1990 committed Jul 30, 2024
1 parent ae9e72e commit a3b627a
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 a3b627a

Please sign in to comment.