Skip to content

Commit

Permalink
Fix function parameter lost during redirect (#42315)
Browse files Browse the repository at this point in the history
* Fix `function` parameter lost during redirect

Currently if you are switching the menu filter in the menu item select modal, the function parameter will be lost on redirect.

* Move function parameter to form url

* Remove hidden input
  • Loading branch information
janschoenherr authored Dec 31, 2023
1 parent eaf830e commit 2912ccd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions administrator/components/com_menus/tmpl/items/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
$editor = $app->getInput()->getCmd('editor', '');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . Session::getFormToken() . '=1';
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . Session::getFormToken() . '=1&function=' . $function;
$multilang = Multilanguage::isEnabled();

if (!empty($editor)) {
// This view is used also in com_menus. Load the xtd script only if the editor is set!
$this->document->addScriptOptions('xtd-menus', ['editor' => $editor]);
$onclick = "jSelectMenuItem";
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&editor=' . $editor . '&' . Session::getFormToken() . '=1';
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&editor=' . $editor . '&' . Session::getFormToken() . '=1&function=' . $function;
}
?>
<div class="container-popup">
Expand Down Expand Up @@ -186,7 +186,6 @@

<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<input type="hidden" name="function" value="<?php echo $function; ?>">
<input type="hidden" name="forcedLanguage" value="<?php echo $app->getInput()->get('forcedLanguage', '', 'cmd'); ?>">
<?php echo HTMLHelper::_('form.token'); ?>

Expand Down

0 comments on commit 2912ccd

Please sign in to comment.