Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[j4] adde set in tinymce not working #37895

Closed
web54 opened this issue May 25, 2022 · 12 comments
Closed

[j4] adde set in tinymce not working #37895

web54 opened this issue May 25, 2022 · 12 comments

Comments

@web54
Copy link

web54 commented May 25, 2022

Steps to reproduce the issue

go into tinymce plugin
In advanced tab : set number of set to 4
delete manager from actually set and assign this group to set 3
make some changes in set 3
login as manager

Expected result

changes in set 3 would be observed if logged as manager

Actual result

no changes seen as if the manager was in another group

System information (as much as possible)

Joomla 4.1.4 ( and lower )

Additional comments

@brianteeman
Copy link
Contributor

Cannot replicate. Make sure that the user is not in more than one group

@brianteeman
Copy link
Contributor

Guess it wasn't a joomla problem after all?

@web54
Copy link
Author

web54 commented Jun 7, 2022

I just will try to replicate ( haven't had time to)

@web54
Copy link
Author

web54 commented Jun 7, 2022

tried with a fresh install (softaculous) and same results
I can give you the credentials or post them there (that is a public test site)

@brianteeman
Copy link
Contributor

please send me the details so I can try to see what is the problem as I cant replicate on my servers

@brianteeman
Copy link
Contributor

never mind - found the bug

@brianteeman
Copy link
Contributor

maybe @Fedik or @dgrammatiko will find the problem before I do.

Basically what is happening is that tinymce is ignoring the additional set. It displays a default instead (which is why I didnt spot it before)

@brianteeman
Copy link
Contributor

and just to make more fun - the same bug is present in j3

@web54
Copy link
Author

web54 commented Jun 7, 2022

Another funny thing: I only saw this bug because I was doing tests for my conference in Brussels about the personalization of the joomla admin for groups.
It's something I never use, and apparently, nobody else does either ;)

@brianteeman
Copy link
Contributor

I personalise it a lot just dont think I've ever had a need for more than two sets

@Fedik
Copy link
Member

Fedik commented Jun 7, 2022

That is correct behavior.
Keep in mind that the order is important, smallest number has "greater access":
Set 0 - greater access
Set 1 - lowest than previous
Set 2 - lowest than previous
Set X - lowest than previous

What you actualy doing:
0 - greater access/ admin
2 - lowest access/ public
3 - greater access/ manager

The plugin will loop from Set X to Set 0 (from lowest access to greater) and stops on last good match.
Because Manager also has Public access the plugin will stop on "Set 2" instead of "Set 3".

// Sort the array in reverse, so the items with lowest access level goes first
krsort($extraOptionsAll);
// Get configuration depend from User group
foreach ($extraOptionsAll as $set => $val)
{
$val = (object) $val;
$val->access = empty($val->access) ? [] : $val->access;
// Check whether User in one of allowed group
foreach ($val->access as $group)
{
if (isset($ugroups[$group]))
{
$extraOptions = $val;
$toolbarParams = (object) $toolbarParamsAll[$set];
}
}
}

@Quy
Copy link
Contributor

Quy commented Jun 27, 2022

Closing per comments.

@Quy Quy closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants