diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index d7516e1b936..6d89aba67e6 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1124,7 +1124,11 @@ class core_renderer extends renderer_base { $output = html_writer::tag('div', $output); // now the form itself around it - $url = $button->url->out_omit_querystring(); // url without params + if ($button->method === 'get') { + $url = $button->url->out_omit_querystring(true); // url without params, the anchor part allowed + } else { + $url = $button->url->out_omit_querystring(); // url without params, the anchor part not allowed + } if ($url === '') { $url = '#'; // there has to be always some action } @@ -1210,8 +1214,13 @@ class core_renderer extends renderer_base { $output = html_writer::tag('div', $output); // now the form itself around it + if ($select->method === 'get') { + $url = $select->url->out_omit_querystring(true); // url without params, the anchor part allowed + } else { + $url = $select->url->out_omit_querystring(); // url without params, the anchor part not allowed + } $formattributes = array('method' => $select->method, - 'action' => $select->url->out_omit_querystring(), + 'action' => $url, 'id' => $select->formid); $output = html_writer::tag('form', $output, $formattributes);