Fixes #3391 - Unable to open object manager select field modal if options contains invalid data (like undefined or null).
This commit is contained in:
parent
ff00eb07fb
commit
b9a9cd611b
1 changed files with 6 additions and 1 deletions
|
@ -8,7 +8,12 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
|
||||||
params.data_option = params.data_option_new
|
params.data_option = params.data_option_new
|
||||||
|
|
||||||
if attribute.value == 'select' && params.data_option? && params.data_option.options?
|
if attribute.value == 'select' && params.data_option? && params.data_option.options?
|
||||||
sorted = _.map params.data_option.options, (value, key) -> [key.toString(), value.toString()]
|
sorted = _.map(
|
||||||
|
params.data_option.options, (value, key) ->
|
||||||
|
key = '' if !key || !key.toString
|
||||||
|
value = '' if !value || !value.toString
|
||||||
|
[key.toString(), value.toString()]
|
||||||
|
)
|
||||||
params.data_option.sorted = sorted.sort( (a, b) -> a[1].localeCompare(b[1]) )
|
params.data_option.sorted = sorted.sort( (a, b) -> a[1].localeCompare(b[1]) )
|
||||||
|
|
||||||
item = $(App.view('object_manager/attribute')(attribute: attribute))
|
item = $(App.view('object_manager/attribute')(attribute: attribute))
|
||||||
|
|
Loading…
Reference in a new issue