? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
14 Apr 2019

Pull Request for Issue #24575

Summary of Changes

Forcing userstate to administrator modules

Testing Instructions

Load Site Modules Manager to be sure userstate is set to site modules
Switch to Control Panel
Edit a module through the cog

Before patch

The module position is empty

After patch

It is now correctly using cpanel position

@chmst @franz-wohlkoenig

avatar infograf768 infograf768 - open - 14 Apr 2019
avatar infograf768 infograf768 - change - 14 Apr 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2019
Category Administration Templates (admin)
avatar chmst
chmst - comment - 14 Apr 2019

I have tested this item successfully on a0846e4


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

avatar chmst chmst - test_item - 14 Apr 2019 - Tested successfully
avatar infograf768 infograf768 - change - 14 Apr 2019
Labels Added: ?
avatar infograf768
infograf768 - comment - 14 Apr 2019

Solved conflicts.
One more tester.

avatar Quy
Quy - comment - 15 Apr 2019

I have tested this item successfully on 286b10c


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

avatar Quy
Quy - comment - 15 Apr 2019

I have tested this item successfully on 286b10c


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

avatar Quy Quy - test_item - 15 Apr 2019 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Apr 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Apr 2019

Status "Ready To Commit".

avatar SharkyKZ
SharkyKZ - comment - 15 Apr 2019

This is not the right approach, IMO. The layout should not be setting user state. This way admin filter is forced whenever a page containing a module with this layout is visited.

avatar infograf768
infograf768 - comment - 15 Apr 2019

@SharkyKZ
There are 2 possible solutions:

  1. Check if the position is cpanel and set userstate in the layout.
    This would work for all admin modules in the cpanel position and only for these

  2. The only other solution I see is to add in EACH admin module helper the code
    Factory::getApplication()->setUserState('com_modules.modules.client_id', 1);

What do you propose?

avatar SharkyKZ
SharkyKZ - comment - 15 Apr 2019

One option is to get client_id from form data in the field here:

$clientId = Factory::getApplication()->getUserState('com_modules.modules.client_id', 0);

$clientId  = $this->form->getValue('client_id', '', Factory::getApplication()->getUserState('com_modules.modules.client_id', 0));

Other option would be to add client_id to URL and have controller set the user state based on that.

avatar infograf768
infograf768 - comment - 15 Apr 2019

Please make the PR yourself as I do not understand what you propose.

avatar infograf768 infograf768 - change - 16 Apr 2019
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[4.0] Solving #24575: Module position no more empty when coming from CPanel
[4.0] Module position no more empty when coming from CPanel
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar SharkyKZ
SharkyKZ - comment - 23 Apr 2019

See PR #24698 for alternative.

avatar infograf768
infograf768 - comment - 23 Apr 2019

Closing in favour of #24698
Thanks @SharkyKZ

avatar infograf768 infograf768 - close - 23 Apr 2019
avatar infograf768 infograf768 - change - 23 Apr 2019
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2019-04-23 07:55:46
Closed_By infograf768

Add a Comment

Login with GitHub to post a comment