? ? Pending

User tests: Successful: 2 coolcat-creations, simbus82 Unsuccessful: 0

avatar laoneo
laoneo
4 Apr 2022

Pull Request for Issue #22150.

Summary of Changes

When changing a menu item type for an unsaved menu item, then the session data should be used instead of the filter data or null. This pr puts the behavior from #6976 as fallback which is fine IMO.

Testing Instructions

  • In backend menus, click "New"
  • Enter a name, set an access level and other different attributes in the right sidebar
  • Then click on the "select menu type" button
  • Choose a different Menutype

Actual result BEFORE applying this Pull Request

The access level and other changed attributes values do get reverted.

Expected result AFTER applying this Pull Request

The access level and other changed attributes keep the previous defined values.

avatar laoneo laoneo - open - 4 Apr 2022
avatar laoneo laoneo - change - 4 Apr 2022
Status New Pending
avatar laoneo laoneo - change - 4 Apr 2022
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2022
Category Administration com_menus
avatar laoneo laoneo - change - 4 Apr 2022
Title
When loading the menu form data, fallback to the session one
[4.1] When loading the menu form data, fallback to the session one
avatar laoneo laoneo - edited - 4 Apr 2022
avatar laoneo laoneo - change - 4 Apr 2022
Title
[4.1] When loading the menu form data, fallback to the session one
[4.1] When loading a new menu item type, keep the session data and fallback to filter
avatar laoneo laoneo - edited - 4 Apr 2022
avatar simbus82
simbus82 - comment - 4 Apr 2022

I have tested this item ? unsuccessfully on 0635d4e

Tested on Joomla 4.1.2.

The access level and other changed attributes are keeping the previous defined values after one or more changes of the menu type. This is really great.

The bad is that now the behaviour from #6976 is not working anymore.
If i do a filter selection in the menu manager, after creating a new menu item, i have no preselected values.

If the loss of this functionality was unintended, the test was unsuccessful for me.
Is it not possible to maintain both behaviors? I like this patch, it can save us a lot of time!


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

avatar simbus82 simbus82 - test_item - 4 Apr 2022 - Tested unsuccessfully
avatar coolcat-creations
coolcat-creations - comment - 4 Apr 2022

I tested the prebuilt package and tested also on a 4.1.2 live site without patch.
For what it should solve the PR Works but I agree to @simbus82 that it does not have the preselected value of the permissions in the item anymore.

avatar laoneo
laoneo - comment - 4 Apr 2022

@simbus82 can you post some screenshots how to reproduce the reverted behavior? When I retry your steps I still have the filter in the form set.

avatar coolcat-creations
coolcat-creations - comment - 4 Apr 2022

The filters are still set but not the permission one @laoneo

avatar laoneo
laoneo - comment - 4 Apr 2022

Not sure if I can fix the permissions as well, will look into this. But as far as I understood @simbus82, something along the lines is reset in the filters.

avatar simbus82
simbus82 - comment - 4 Apr 2022

@simbus82 can you post some screenshots how to reproduce the reverted behavior? When I retry your steps I still have the filter in the form set.

Same as @coolcat-creations has written, i have double checked and only the permission is not set by previous filters selection.
With the screenshots you do not see too much, but I had a video, only it is full of "private" data of the site used as a test.
Maybe the last row in your code need to be like others?

$data['parent_id'] = $data['parent_id'] ?? ($filters['parent_id'] ?? null);
$data['published'] = $data['published'] ?? ($filters['published'] ?? null);
$data['language']  = $data['language'] ?? ($filters['language'] ?? null);
$data['access']    = $data['access'] ?? ($filters['access'] ?? Factory::getApplication()->get('access')); /* THIS */
avatar laoneo
laoneo - comment - 5 Apr 2022

Can you guys test again? The access level should be unset now.

avatar simbus82
simbus82 - comment - 5 Apr 2022

I have tested this item successfully on fe143e8

Sure!

The access level and other changed attributes are keeping the previous defined values and the behaviour from #6976 is working!

Thanks a lot!

PS: maybe we can open a new feature request for extend the behaviour to the "parent item" field too.


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

avatar simbus82 simbus82 - test_item - 5 Apr 2022 - Tested successfully
avatar coolcat-creations
coolcat-creations - comment - 5 Apr 2022

I have tested this item successfully on fe143e8

Tested successfully.
Me and other Joomla users waited for this bugfix for at least 4 years it's a day to celebrate for me because this was a very very annoying bug :-)

THANK YOU SO MUCH !!!!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37478.
avatar coolcat-creations coolcat-creations - test_item - 5 Apr 2022 - Tested successfully
avatar laoneo
laoneo - comment - 5 Apr 2022

THANK YOU SO MUCH !!!!

You worked for that too, just in the background ?

avatar laoneo laoneo - change - 5 Apr 2022
Status Pending Ready to Commit
avatar laoneo
laoneo - comment - 5 Apr 2022

RTC


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

avatar Quy Quy - change - 5 Apr 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-04-05 14:24:11
Closed_By Quy
Labels Added: ?
avatar Quy Quy - close - 5 Apr 2022
avatar Quy Quy - merge - 5 Apr 2022
avatar Quy
Quy - comment - 5 Apr 2022

Thanks

Add a Comment

Login with GitHub to post a comment