diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-08-06 08:21:55 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-08-06 08:21:55 +0100 |
commit | 96509275b883522d8a16bed56c998a2a2fe0424f (patch) | |
tree | 8a905f8eee3e7772c11f811003d310094f78d6a2 /util/dataforms.lua | |
parent | 56b0cd35c6768193b5c237c176339f176b73f1a2 (diff) | |
parent | 27bbd90669cf314d6945892456e4ed0a20590302 (diff) | |
download | prosody-96509275b883522d8a16bed56c998a2a2fe0424f.tar.gz prosody-96509275b883522d8a16bed56c998a2a2fe0424f.zip |
Merge with jonasw
Diffstat (limited to 'util/dataforms.lua')
-rw-r--r-- | util/dataforms.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua index a75e8db0..a5733b83 100644 --- a/util/dataforms.lua +++ b/util/dataforms.lua @@ -142,7 +142,7 @@ end local field_readers = {}; -function form_t.data(layout, stanza) +function form_t.data(layout, stanza, current) local data = {}; local errors = {}; local present = {}; @@ -157,7 +157,9 @@ function form_t.data(layout, stanza) end if not tag then - if field.required then + if current and current[field.name] ~= nil then + data[field.name] = current[field.name]; + elseif field.required then errors[field.name] = "Required value missing"; end elseif field.name then |