User tests: Successful: Unsuccessful:
Currently if you are switching the menu filter in the menu item select modal, the function parameter will be lost on redirect.
This PR prevents the function
parameter from being omitted upon switching menus. It does that by adding the parameter to the redirect url if present.
Go to /administrator/index.php?option=com_menus&view=items&layout=modal&tmpl=component&function=myCustomFunction
and switch the menu. The redirected url will have the new menutype
parameter, but is missing the function
parameter in the url.
The function
parameter is missing.
The function
parameter is no longer missing.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_menus |
The modal select for Menu in Joomla 5 does not required "function" parameter to work.
It was updated to new approach with use of postMessage()
#41629
Where do you use it?
If you still need it, then please update your PR, to place it in the modal layout (form url), instead of controller.
Change here
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . Session::getFormToken() . '=1&function=' . $function;
But note: use of "function" will be removed in future.
Thanks for the reply. Maybe I should have directed this at the 4.0 dev branch?
Anyway, it can't be moved to the modal.php. It's about the redirect in the controller. The redirect is done without the function
parameter.
it can't be moved to the modal.php
it can, if you try what I have suggested, you will see that it works very well ?
The function
variable is very layout specific thing, I do not think it should be in controller.
Maybe I should have directed this at the 4.0 dev branch?
Yes, I think, it is a bug. For 4.4-dev branch should be okay, in theory.
If you switch the menu, the controller won't display the modal.php, because it redirects previously and ignores the function
parameter.
Need to update URL for the form action #42315 (comment)
I am sorry, but have you tried adding the parameter to the form action? In the modal.php, the function
parameter is already set in the hidden
input field.
The POST request is being redirected in the Controller and therefore converted to a GET request, which does not have the function
parameter.
I would not suggest you it, if it would not work
Labels |
Added:
PR-5.0-dev
|
Mea culpa, you are right. I've updated the pull request. Thank you very much.
I have tested this item ✅ successfully on 41022b7
I have tested this item ✅ successfully on 41022b7
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-12-31 08:39:33 |
Closed_By | ⇒ | bembelimen | |
Labels |
Added:
RTC
bug
Removed: ? |
Thx