You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allocated User Hours report never lists any users #524
What happens
With a project that has active tasks assigned to users, Reports → Allocated User Hours (daily or weekly) shows "Allocated hours: 0.00", "Total capacity: 0.00" and no user rows. The task-level breakdown under the totals logs Undefined array key warnings (allocateduserhours.php L199).
Cause showDays() and showWeeks() (includes/cleanup_functions.php) build one row per entry of the global $user_list, and the capacity totals use count($user_list). modules/reports/reports/allocateduserhours.php never sets $user_list, so it is always empty: the hours collected in $user_usage are never shown, and $user_names (filled in the same loop) is empty when L199 reads it.
Until 2026-10-28 the weekly view did not even get this far: it died on a static call to Date_Calc::weekOfYear() and then on count(null) (fixed in 6a76287, "Allocated User Hours: stop calling Date_Calc::weekOfYear() statically", on dev-5.0.0, not yet pushed).
Fix
Load the users before showDays()/showWeeks(), keyed by user id with user_username, contact_first_name, contact_last_name — e.g. the users that appear in $user_usage, or all active users when "all users" is selected, and only the chosen user otherwise. Small-to-medium effort; check the totals against a known set of tasks afterwards.
Related: the docs screenshot run noted "it shows nothing unless user 0 (all users) is chosen, and total capacity shows 0".
Activity
Allocated User Hours: list the users and count them in the totals