RTC bug PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar janschoenherr
janschoenherr
7 Nov 2023

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

Summary of Changes

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.

Testing Instructions

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.

Actual result BEFORE applying this Pull Request

The function parameter is missing.

Expected result AFTER applying this Pull Request

The function parameter is no longer missing.

Link to documentations

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

avatar janschoenherr janschoenherr - open - 7 Nov 2023
avatar janschoenherr janschoenherr - change - 7 Nov 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2023
Category Administration com_menus
avatar brianteeman
brianteeman - comment - 7 Nov 2023

image

avatar janschoenherr janschoenherr - change - 7 Nov 2023
The description was changed
avatar janschoenherr janschoenherr - edited - 7 Nov 2023
avatar janschoenherr janschoenherr - change - 7 Nov 2023
The description was changed
avatar janschoenherr janschoenherr - edited - 7 Nov 2023
avatar janschoenherr janschoenherr - change - 7 Nov 2023
The description was changed
avatar janschoenherr janschoenherr - edited - 7 Nov 2023
avatar Fedik
Fedik - comment - 17 Nov 2023

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';

To:

$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.

avatar janschoenherr
janschoenherr - comment - 18 Nov 2023

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.

avatar Fedik
Fedik - comment - 18 Nov 2023

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.

avatar janschoenherr
janschoenherr - comment - 18 Nov 2023

If you switch the menu, the controller won't display the modal.php, because it redirects previously and ignores the function parameter.

avatar Fedik
Fedik - comment - 18 Nov 2023

Need to update URL for the form action #42315 (comment)

avatar janschoenherr
janschoenherr - comment - 19 Nov 2023

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.

avatar Fedik
Fedik - comment - 19 Nov 2023

I would not suggest you it, if it would not work

avatar janschoenherr janschoenherr - change - 20 Nov 2023
Labels Added: PR-5.0-dev
avatar janschoenherr
janschoenherr - comment - 20 Nov 2023

Mea culpa, you are right. I've updated the pull request. Thank you very much.

avatar Fedik Fedik - test_item - 21 Nov 2023 - Tested successfully
avatar Fedik
Fedik - comment - 21 Nov 2023

I have tested this item ✅ successfully on 41022b7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42315.

avatar fgsw fgsw - test_item - 1 Dec 2023 - Tested successfully
avatar fgsw
fgsw - comment - 1 Dec 2023

I have tested this item ✅ successfully on 41022b7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42315.

avatar Quy Quy - change - 1 Dec 2023
Status Pending Ready to Commit
avatar Quy
Quy - comment - 1 Dec 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42315.

avatar Quy Quy - change - 1 Dec 2023
Labels Added: ?
avatar bembelimen bembelimen - change - 31 Dec 2023
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: ?
avatar bembelimen bembelimen - close - 31 Dec 2023
avatar bembelimen bembelimen - merge - 31 Dec 2023
avatar bembelimen
bembelimen - comment - 31 Dec 2023

Thx

Add a Comment

Login with GitHub to post a comment