214 empty lists fixes
This commit is contained in:
@@ -74,8 +74,9 @@
|
||||
<m:field>p.svc_operation_cfs_param</m:field>
|
||||
<m:field>p.label</m:field>
|
||||
<m:field>p.data_type</m:field>
|
||||
<m:field>null as data_descriptor</m:field>
|
||||
<m:field formatter=#function(x){return listToArray(x);}# type="list">p.value_list</m:field>
|
||||
<m:field>null as data_descriptor</m:field>
|
||||
<!--- стоит помнить, что formatter выполняется при окончательном форматировании резалтсета в json --->
|
||||
<m:field formatter=#(x)=>((isArray(x) OR isEmpty(x))? x : listToArray(x))#> p.value_list</m:field><!--- ниже мы обрабатываем резалтсет и в случае, когда подразумевается список, заменяем пустое значение пустым массивом, который интерпретируется как пустой список (по крайней мере не пользуемся специальным текстовым значением) --->
|
||||
<m:field <!--- formatter=#function(x){return listToArray(generateValueList(x));}# --->>p.func</m:field><!--- *** отчаявшись сделать красиво --->
|
||||
<m:field>p.ref_svc_id</m:field>
|
||||
<m:field formatter=#request.castToBool#>p.is_required</m:field>
|
||||
@@ -149,8 +150,12 @@
|
||||
argumentCollection=#args#
|
||||
returnVariable="local.qCfsParam.value_list"
|
||||
/>
|
||||
</cfif>
|
||||
</cfif>
|
||||
|
||||
<cfif (len(local.qCfsParam.func) OR len(local.qCfsParam.expression) OR len(local.qCfsParam.state_path) OR len(local.qCfsParam.nested_ref))
|
||||
AND len(local.qCfsParam.value_list) EQ 0>
|
||||
<cfset local.qCfsParam.value_list = []/>
|
||||
</cfif>
|
||||
|
||||
<cfif data_type EQ "map" OR data_type EQ "map-fixed" OR data_type EQ "array-map-fixed"><!--- *** частичное дублирование с instance_operation_cfs_param.processMap --->
|
||||
<!--- без полей инстанса, только шаблон --->
|
||||
@@ -209,7 +214,9 @@
|
||||
</cfif><!---/map --->
|
||||
|
||||
</cfloop>
|
||||
<cfset queryDeleteColumn(local.qCfsParam, "func")/>
|
||||
|
||||
<!--- <cfdump var=#local.qCfsParam# abort=true/> --->
|
||||
<!--- <cfset queryDeleteColumn(local.qCfsParam, "func")/> --->
|
||||
|
||||
<cfset var out=structNew("linked")/>
|
||||
<cfset "out.queryDurationMs"=getTickCount() - request.startTickCount/>
|
||||
@@ -233,6 +240,7 @@
|
||||
</cfif>
|
||||
<cfset var rec = this.helper.appendRecord(structNew("linked"), "", local.cfsParamMap, local.qCfsParam, this.helper.snake2camel)/>
|
||||
<!--- <cfdump var=#rec# abort=true/> --->
|
||||
|
||||
<cfset arrayAppend(out.svcOperation.cfsParams, rec)/>
|
||||
</cfloop>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user