Roxen.git/
server/
etc/
modules/
Variable.pmod/
module.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2019-05-22
2019-05-22 09:37:01 by Karl Gustav Sterneberg <kg@roxen.com>
8466916549dd0140419f44e9a5c2f508d02fe724 (
11
lines) (+
9
/-
2
)
[
Show
|
Annotate
]
Branch:
feature/WS-489-var-multiplechoice-allow-save-none
Variable MultipleChoice: Allow saving emtpy selection.
[WS-489]
1182:
int(0..1) set_from_form(RequestID id, void|int(0..1) force) { if (!multiselect) return ::set_from_form(id);
-
if (!id->real_variables[path()]) return 0;
+
if (!id->real_variables[path()]
&&
+
!id->real_variables[path(
)
+ ".hidden"])
return 0;
set_warning(0); mapping(string:string) m = get_form_vars(id); array(mixed) values = ({});
1262:
Roxen.make_tag( "input", m), Roxen.html_encode_string(title)); }
-
return
res + "</table>";
+
res +
=
"</table>";
+
// Hidden field allows saving of empty selection.
+
res += Roxen.make_tag( "input", ([ "type" : "hidden",
+
"name" : path() + ".hidden",
+
"value" : "hidden" ]));
+
return res;
} else { string current = _name (query()); int selected = 0;