Fix #245 - [Legacy] Sugar_html onclick action issues

- replace sugar_html submit actions with get request, as required for the new UI
This commit is contained in:
Matt Lorimer 2023-04-13 16:47:00 +01:00 committed by Jack Anderson
parent 5e8175c97a
commit 66686b2d0d

View file

@ -570,10 +570,9 @@ function replaceFormClick(&$dom_tree = array(), $js_form = '', &$hidden_field_ex
}
//Onclick handler contains returning a variable, for example it prompts a confirm message.
if (strpos($dom_tree['onclick'], "return ") !== false) {
$dom_tree['onclick'] = $js_form.' var _onclick=(function(){ldelim}'.$dom_tree['onclick']."{rdelim}()); if(_onclick!==false) _form.submit();";
} else {
$dom_tree['onclick'] = $js_form.$dom_tree['onclick']."_form.submit();";
$dom_tree['onclick'] = ' var _onclick=(function(){ldelim}' . $dom_tree['onclick'] . "{rdelim}()); if(_onclick!==false) ";
}
$dom_tree['onclick'] = $js_form.$dom_tree['onclick']."window.location.href='index.php?' + (new URLSearchParams(new FormData(_form)).toString());";
$set_submit = true;
}