util.dataforms: Allow overriding default options even if the form has such

This commit is contained in:
Kim Alvefur 2018-08-03 22:24:35 +02:00
parent 414778ee5d
commit 6b55f14950

View file

@ -58,7 +58,7 @@ function form_t.form(layout, data, formtype)
end end
local options = field.options; local options = field.options;
if formtype == "form" and not options and value if formtype == "form" and value
and (field_type == "list-single" or field_type == "list-multi") then and (field_type == "list-single" or field_type == "list-multi") then
-- Allow passing dynamically generated options as values -- Allow passing dynamically generated options as values
options, value = value, nil; options, value = value, nil;