? Release Blocker ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
2 Dec 2021

Pull Request for Issue #36179 .

Summary of Changes

The changes makes sure the value in correct type, and uses correct order.

Testing Instructions

Please follow #36179

Actual result BEFORE applying this Pull Request

PHP notice, and configuration loaded incorrectly, eg wrong toolbar for Super admin.

Expected result AFTER applying this Pull Request

Configuration loaded correctly

Documentation Changes Required

no

avatar Fedik Fedik - open - 2 Dec 2021
avatar Fedik Fedik - change - 2 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Dec 2021
Category Front End Plugins
avatar Fedik Fedik - change - 2 Dec 2021
Title
Fix tinymce plugin configuration
[4.0] Fix tinymce plugin configuration
avatar Fedik Fedik - edited - 2 Dec 2021
avatar joomdonation
joomdonation - comment - 2 Dec 2021

If I'm not mistaken, this won't work for old Tiny MCE configuration (for example, site updated from older version 4.0.5 and don't change editor settings after update). In that case, set 2 would be used for Super Users and it's not right.

avatar Fedik
Fedik - comment - 2 Dec 2021

hmhm, yea, I probably better change to krsort() instead of array_reverse().
so it will sort the same for old and new values

avatar Fedik Fedik - change - 2 Dec 2021
Labels Added: Release Blocker ?
avatar joomdonation
joomdonation - comment - 3 Dec 2021

Yes, it works. Or we can just use ksort and stop at the first matching set.

// Sort the array, so the items with highest access level goes first
ksort($extraOptionsAll);

// Get configuration depend from User group
foreach ($extraOptionsAll as $set => $val)
{
	$val = (object) $val;
	$val->access = empty($val->access) ? [] : $val->access;

	if (array_intersect($ugroups, $val->access))
	{
		$extraOptions  = $val;
		$toolbarParams = (object) $toolbarParamsAll[$set];
		break;
	}
}

Compare to the current code, it has super tiny improvement because it does not have to loop through all the sets (stop at the first matching). Let me know if you want to make change, otherwise, I will record my test result.

avatar Fedik
Fedik - comment - 3 Dec 2021

No no, it should not stop on first,
Example if you added some group in two sets (accidentally or in purpose), then it should pick last with higher access level.

Well I would leave it as it is :)

avatar joomdonation
joomdonation - comment - 3 Dec 2021

Not a problem. As I mentioned, it is a super tiny improvement :D.

avatar joomdonation
joomdonation - comment - 3 Dec 2021

I have tested this item successfully on 7de6d18


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

avatar joomdonation joomdonation - test_item - 3 Dec 2021 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 3 Dec 2021

I have tested this item successfully on 7de6d18


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

avatar dgrammatiko dgrammatiko - test_item - 3 Dec 2021 - Tested successfully
avatar alikon alikon - change - 3 Dec 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 3 Dec 2021

RTC


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

avatar khu5h1
khu5h1 - comment - 4 Dec 2021

I have tested this item successfully on 7de6d18


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

avatar khu5h1 khu5h1 - test_item - 4 Dec 2021 - Tested successfully
avatar pritam825
pritam825 - comment - 4 Dec 2021

I have tested this item successfully on 7de6d18


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

avatar pritam825 pritam825 - test_item - 4 Dec 2021 - Tested successfully
avatar wilsonge wilsonge - change - 5 Dec 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-12-05 17:19:03
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 5 Dec 2021
avatar wilsonge wilsonge - merge - 5 Dec 2021
avatar wilsonge
wilsonge - comment - 5 Dec 2021

Thanks!

Add a Comment

Login with GitHub to post a comment