As designed title override and banner text for Unregistered / Unconfirmed user group not used

Affected version
v2.2.12
very similar to (resolved) https://xenforo.com/community/threa...title-or-banner-text-fields-are-empty.198796/
There was some internal discussion about this a while ago that we overlooked but, essentially, the outcome is that this is basically working as designed.

A blank value for a user group doesn't mean it will apply a blank value. It means there is nothing to set so seek out the effective value from the next highest priority group that does have a value.

There's no plans to change this at this time.

User title override, User banner text, and User banner styling for group Unregistered / Unconfirmed do not work (when they have content, not empty as the other report), unless the user is manually placed into that group. I can sort of understand when like you say, the field is blank, but the same thing happens when it's filled in, the values are completely ignored, which in my opinion is a bug.

I want my non-valid users to have some visual distinction on the forums like they already do in the admin panel:
1677890834178.png

non-admin panel:
1677893114366.png

I have the group Unregistered / Unconfirmed as the highest Display styling priority, but its style is not being applied, when the user 'magically' has that group from their Valid status. When i manually add those users to the Unconfirmed group, it displays correctly (last 2 users in image).

groups:
SQL:
MariaDB [xenforo]> SELECT * FROM `xf_user_group` ORDER BY `xf_user_group`.`display_style_priority` ASC;
+---------------+----------------------------+------------------------+--------------+---------------+--------------------------------+---------------+
| user_group_id | title                      | display_style_priority | username_css | user_title    | banner_css_class               | banner_text   |
+---------------+----------------------------+------------------------+--------------+---------------+--------------------------------+---------------+
|             2 | Registered                 |                      0 |              | Registered    | userBanner userBanner--primary | Registered    |
|             4 | Moderating                 |                    900 |              | Moderator     | userBanner userBanner--blue    | Moderator     |
|             3 | Administrative             |                   1000 |              | Administrator | userBanner userBanner--red     | Administrator |
|             1 | Unregistered / Unconfirmed |                   1100 |              | Unconfirmed   | userBanner userBanner--orange  | Unconfirmed   |
+---------------+----------------------------+------------------------+--------------+---------------+--------------------------------+---------------+
4 rows in set (0.000 sec)
users:
SQL:
MariaDB [xenforo]> SELECT `user_id`,`username`,`user_group_id`,`secondary_group_ids`,`display_style_group_id`,`is_banned`,`user_state` FROM `xf_user`;
+---------+---------------------------+---------------+---------------------+------------------------+-----------+------------+
| user_id | username                  | user_group_id | secondary_group_ids | display_style_group_id | is_banned | user_state |
+---------+---------------------------+---------------+---------------------+------------------------+-----------+------------+
|       1 | admin                     |             2 | 3,4                 |                      3 |         0 | valid      |
|       2 | test-disabled             |             2 |                     |                      2 |         0 | disabled   |
|       3 | test-rejected             |             2 |                     |                      2 |         0 | rejected   |
|       4 | test-awaiting             |             2 |                     |                      2 |         0 | moderated  |
|       5 | test-valid                |             2 |                     |                      2 |         0 | valid      |
|       6 | test-banned               |             2 |                     |                      2 |         1 | valid      |
|       7 | test-valid-UnconfirmSecon |             2 | 1                   |                      1 |         0 | valid      |
|       8 | test-rejec-UnconfirmSecon |             2 | 1                   |                      1 |         0 | rejected   |
+---------+---------------------------+---------------+---------------------+------------------------+-----------+------------+
8 rows in set (0.000 sec)
 
This is working as expected.

If a user is "magically" in the 'unconfirmed' state then they're not actually part of that group so the user group styling will not apply.

The admin control panel user list applies styling based on the user state or banned state of the user. It has nothing to do with user groups. The functionality you're after simply doesn't exist. If you want to do something similar, you're going to need to add it yourself (or through an add-on) by modifying the template when the user is not in a valid state.
 
workaround:
I've created 6 User group promotions, to apply the promotion Add user to user groups: Unregistered / Unconfirmed while user state is each of the options other than Valid

it only updates once per hour, but that's an adjustable cron setting .. works better than nothing
 
Top Bottom