Commit bbfcacd7 authored by Sven Franck's avatar Sven Franck

app: correctly pass reference on empty forms (no jio result) to children

parent 2428aa3e
......@@ -6321,7 +6321,8 @@
search, search_id, kid, is_html, is_dynamic, is_id, i, j, k, last,
encoded, wrapper, active, selector, update_target, target, widget,
quirk_dict, generator, pointer_results, data_total_rows, is_parameter,
param_len, parameter, no_item, dyno, container, has_props, widget_dyno;
param_len, parameter, no_item, dyno, container, has_props, widget_dyno,
set_reference;
pass = reply.pass;
pass.config_dict = pass.config_dict || {};
......@@ -6443,7 +6444,21 @@
// no items, need no show! (default to empty {} if none provided
if (pointer_results.data.total_rows === 0) {
if (quirk_dict.allow_new || quirk_dict.force_new) {
pointer_results = {"data": {"total_rows": 1, "rows": [{"doc": {}}]}};
// NOTE: on updates with force_new, reference must be passed to not
// have undefined form-id values
if (quirk_dict.update) {
set_reference = {
"doc": {},
"reference": pass.url_dict.reference
};
}
pointer_results = {
"data": {
"total_rows": 1,
"rows": [set_reference || {"doc": {}}]
}
};
} else {
quirk_dict.no_show = quirk_dict.no_items || {};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment