File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -349,19 +349,20 @@ function ImportSource(req, done) {
349349 await Promise . all ( plugindata . pluginIncludes . map ( async ( { type, name } ) => {
350350 const pluginQuery = await dbRetrieve ( `${ type } type` , { name } ) ;
351351 const plugin = pluginQuery [ 0 ] . _doc ;
352- const pluginGlobals = plugin . globals ;
353- if ( ! pluginGlobals ) return ;
352+ const schemaGlobals = plugin . globals ;
353+ if ( ! schemaGlobals ) return ;
354+ const schemaDefaults = { } ;
354355 const typeKey = type === 'component' || type === 'extension' ?
355356 `_${ type } s` :
356357 `_${ type } ` ;
357358 const pluginKey = `_${ plugin [ type ] } ` ;
358359 if ( ! courseGlobals [ typeKey ] ) {
359360 courseGlobals [ typeKey ] = { } ;
360361 }
361- Object . entries ( pluginGlobals ) . forEach ( ( [ key , value ] ) => {
362- pluginGlobals [ key ] = value . default ;
362+ Object . entries ( schemaGlobals ) . forEach ( ( [ key , value ] ) => {
363+ schemaDefaults [ key ] = value . default ;
363364 } ) ;
364- courseGlobals [ typeKey ] [ pluginKey ] = _ . defaults ( courseGlobals [ typeKey ] [ pluginKey ] , pluginGlobals ) ;
365+ courseGlobals [ typeKey ] [ pluginKey ] = _ . defaults ( courseGlobals [ typeKey ] [ pluginKey ] , schemaDefaults ) ;
365366 } ) ) ;
366367 await dbUpdate ( 'course' , { _id : courseId } , { _globals : courseGlobals } ) ;
367368 } ,
You can’t perform that action at this time.
0 commit comments