Skip to content

Fix: show correct status label for all user types in user_information#8676

Open
addow wants to merge 1 commit into
chamilo:masterfrom
webstone:fix/user-information-status-label
Open

Fix: show correct status label for all user types in user_information#8676
addow wants to merge 1 commit into
chamilo:masterfrom
webstone:fix/user-information-status-label

Conversation

@addow

@addow addow commented Jun 30, 2026

Copy link
Copy Markdown

Summary

The status field on /main/admin/user_information.php used a binary check:

// Before
get_lang('Status') => 1 === $user->getStatus() ? get_lang('Trainer') : get_lang('Learner'),

This caused users with status DRH (4), SESSIONADMIN (3), STUDENT_BOSS (17) and INVITEE (20) to incorrectly display as Learner, even when they held HR manager, session admin, or invitee roles.

The fix replaces the binary check with api_get_status_langvars(), which already provides the complete mapping for all status values and is used in other parts of the codebase.

// After
get_lang('Status') => api_get_status_langvars()[$user->getStatus()] ?? get_lang('Learner'),

Status values covered

Constant Value Label
COURSEMANAGER 1 Teacher
SESSIONADMIN 3 Sessions administrator
DRH 4 Human Resources Manager
STUDENT 5 Learner
ANONYMOUS 6 Anonymous
STUDENT_BOSS 17 Student boss
INVITEE 20 Invited

Test plan

  • Open /main/admin/user_information.php?user_id=<id> for users with each status type
  • Verify the Status row shows the correct label for DRH, Session admin, Student boss and Invitee users
  • Verify Teacher and Learner users still display correctly

@addow addow changed the title fix(admin): show correct status label for all user types in user_information Fix: show correct status label for all user types in user_information Jun 30, 2026
@addow addow force-pushed the fix/user-information-status-label branch 3 times, most recently from c5ec250 to 4d5e9b8 Compare June 30, 2026 11:53
…rmation

The status display used a binary check (status == 1 → Trainer, else → Learner),
causing DRH, Session admin, Student boss and Invitee users to incorrectly
display as Learner. Now uses api_get_status_langvars() which covers all
status values (COURSEMANAGER, SESSIONADMIN, DRH, STUDENT, ANONYMOUS,
STUDENT_BOSS, INVITEE).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant