Primary User Group display styling gets clobbered by Secondary User Group despite higher priority

Warchamp7

Active member
Group1 has styling priority of 800 and color: red;
Group2 has styling priority of 500 and color: blue;

UserA's primary user group is Group1 and is in the secondary user group Group2

Result:
UserA's name is blue. Making Group1 a secondary group for UserA makes their name red


Expected:
User's name is red due to the highest display priority group. If anything else, I would expect primary user group to clobber any secondary groups regardless of priority (Though not preferred, really)
 
Last edited:
Whether a group is primary or secondary doesn't make a difference.

I just tested this locally and I get the expected result every time. So there's likely something else wrong.
 
Whether a group is primary or secondary doesn't make a difference.

I just tested this locally and I get the expected result every time. So there's likely something else wrong.

Super strange.

This is two users on my dev site right now. They're both in the Moderator and Premium user groups, and Moderator has a higher display styling.

They both had Moderator as their primary user group. I changed User 1 to Registered as their primary and added Moderator to their secondary groups, and they display as expected (Moderator red has higher priority)

1526060828120.webp

Code:
<span class="username--style4 username--staff username--moderator">User 1</span>
Code:
<span class="username--style24 username--staff username--moderator">User 2</span>

Edit: Interesting. I just changed User 1 back to Moderator primary group with Registered secondary. They're still displaying as expected.

Editing User2 and hitting Save without making any changes also fixed their name.

Bad user cache?
 
Last edited:
THIS is what type of issues when you go to playing outside the intended use of the suggested groups.
ALL users should have REGISTERED as their base and then any additional user groups added as SECONDARY. You should NOT be using other groups as primary other than REGISTERED. Doing so negates the very design features of the way XenForo was targeted to work and introduces complexities that can cause unexpected display/responses.
It can be done, but why try to shoe-horn the way other scripts typically worked into a design that was not targeted to function primarily that way.


I bring your attention to
https://xenforo.com/community/resources/implementing-permissions-across-multiple-user-groups.358/
 
THIS is what type of issues when you go to playing outside the intended use of the suggested groups.
ALL users should have REGISTERED as their base and then any additional user groups added as SECONDARY. You should NOT be using other groups as primary other than REGISTERED. Doing so negates the very design features of the way XenForo was targeted to work and introduces complexities that can cause unexpected display/responses.
It can be done, but why try to shoe-horn the way other scripts typically worked into a design that was not targeted to function primarily that way.


I bring your attention to
https://xenforo.com/community/resources/implementing-permissions-across-multiple-user-groups.358/

Thanks Tracy I know, I appreciate the very condescending and completely unhelpful reply.

If you knew what you were talking about when deciding to take that tone you'd know that Primary and Secondary exist for the purposes of properly handling importing from other forum software, which our website has done in the past.

Regardless of that fact and the fact I've fixed these users permissions, it doesn't change that this aspect of XenForo is not working as intended for some reason, and no amount of being a smug jerk about it will change that.
 
Last edited:
If you knew what you were talking about when deciding to take that tone you'd know that Primary and Secondary exist for the purposes of properly handling importing from other forum software, which our website has done in the past.
There is no "condescending" tone meant. It's that to frequently the issue IS that people try to force the way groups work from other scripts onto the way it does with XenForo.
This causes issues very similar to what you have seen. I'm well aware of what happens with groups during imports from others scripts as I've done imports from myBB, SMF, IPS and vB.

The point of emphasizing the suggested way was to get it to a point where it's KNOWN to work in the correct manner. When you start introducing variables of "I've changed my primary group to something else and set registered to a secondary" you are playing outside the parameters that are suggested and are the ones frequently used.

I'd assumed that you had already imported and modified your groups to the recommendation. Nowhere in your content did you imply this was a new import that still was using the grouping settings it had from the original importation.... the implication was that was already done. If it HAS already been done (the modifications) then your reflected way of changing primary groups is outside the suggested path of how to implement permissions across multiple groups (ergo the link that was given that advises of the recommended way).

As for cache... are you using CloudFlare or similar? Are you using any add-ons that modify the user banners/groups?
What PHP version and are you using memcached/Redis?

You specifically stated that
They both had Moderator as their primary user group. I changed User 1 to Registered as their primary and added Moderator to their secondary groups, and they display as expected (Moderator red has higher priority)
and that indicated it worked as expected (which using Registered as the primary is what is recommended).

It should still work doing the way you are attempting to do (not using registered as primary) as the priority should not matter which group is primary. It's just easier to trouble shoot when one uses the recommended process.
 
The point of emphasizing the suggested way was to get it to a point where it's KNOWN to work in the correct manner. When you start introducing variables of "I've changed my primary group to something else and set registered to a secondary" you are playing outside the parameters that are suggested and are the ones frequently used.

Doesn't change the this setup is expected to work, and is tested to work, and is expected to work.


You specifically stated that and that indicated it worked as expected (which using Registered as the primary is what is recommended).

It should still work doing the way you are attempting to do (not using registered as primary) as the priority should not matter which group is primary. It's just easier to trouble shoot when one uses the recommended process.

Editing User2 and hitting Save without making any changes also fixed their name.

User2 is set up with Moderator as their primary group. They display styling was wrong until I edited the user, changed nothing, and saved them, prompting XenForo to recalculate the display priority. Nothing on the user changed, but their styling still updated. Something is wonky.
 
Well, good luck with figuring it out... as you won't be getting as wide a variety of assistance since you are using the groups in a non-standard (for XF) way and there are fewer admins that do that which can give you input (other than what you have already received).
 
Top Bottom