Comparison

util/dataforms.lua @ 9047:ab3488ee3ca5

util.dataforms: Ensure fields have names when collecting data (fixes traceback, thanks Martin)
author Kim Alvefur <zash@zash.se>
date Sun, 15 Jul 2018 22:50:05 +0200
parent 8984:fa80b3231a02
child 9084:572b6858db03
comparison
equal deleted inserted replaced
9046:7cdc718312c8 9047:ab3488ee3ca5
153 153
154 if not tag then 154 if not tag then
155 if field.required then 155 if field.required then
156 errors[field.name] = "Required value missing"; 156 errors[field.name] = "Required value missing";
157 end 157 end
158 else 158 elseif field.name then
159 present[field.name] = true; 159 present[field.name] = true;
160 local reader = field_readers[field.type]; 160 local reader = field_readers[field.type];
161 if reader then 161 if reader then
162 data[field.name], errors[field.name] = reader(tag, field.required); 162 data[field.name], errors[field.name] = reader(tag, field.required);
163 end 163 end