@@ -95,13 +95,12 @@ class EntityBase {
9595 InvalidParameterException.CheckEmpty(" EntityBase" , " key" , key)
9696
9797 sanitizer := StringSanitizer()
98-
9998 this.app := app
10099 this.keyVal := sanitizer.Process (key)
101100 this.configObj := configObj
102101 this.parentEntity := parentEntity
103-
104- this.entityData := LayeredEntityData(configObj.Clone (), this.InitializeDefaults() )
102+ defaults := this.InitializeDefaults()
103+ this.entityData := LayeredEntityData(configObj.Clone (), defaults )
105104 this.entityData.SetDataSourceDefaults(this.AggregateDataSourceDefaults())
106105 this.entityData.SetAutoDetectedDefaults(this.AutoDetectValues())
107106 this.entityData.StoreOriginal()
@@ -136,13 +135,13 @@ class EntityBase {
136135
137136 ; NOTICE: Object not yet fully loaded. Might not be safe to call this.entityData
138137 InitializeDefaults () {
139- defaults := Map()
140- defaults[ " DataSourceKeys" ] := [" api" ]
141- defaults[ " DataSourceItemKey" ] := ""
142- defaults[ " DisplayName" ] := this.keyVal
143- defaults[ " AssetsDir" ] := this.app.Config.AssetsDir . " \" . this.keyVal
144- defaults[ " DependenciesDir" ] := this.app.appDir . " \Vendor"
145- return defaults
138+ return Map(
139+ " DataSourceKeys" , [" api" ],
140+ " DataSourceItemKey" , "" ,
141+ " DisplayName" , this.keyVal,
142+ " AssetsDir" , this.app.Config.AssetsDir . " \" . this.keyVal,
143+ " DependenciesDir" , this.app.appDir . " \Vendor"
144+ )
146145 }
147146
148147 AggregateDataSourceDefaults (includeParentData := true, includeChildData := true ) {
@@ -187,7 +186,7 @@ class EntityBase {
187186 itemKey := this.GetDataSourceItemKey()
188187
189188 if (itemKey) {
190- dsData := dataSource.ReadJson(this.GetDataSourceItemKey() , this.GetDataSourceItemPath())
189+ dsData := dataSource.ReadJson(itemKey , this.GetDataSourceItemPath())
191190
192191 if (dsData) {
193192 this.existsInDataSource := true
0 commit comments