Skip to content

Allocated User Hours report never lists any users #524

Closed

Description

@caseysoftware

Branches: dev-5.0.0 and dev-6.0.0

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

  1. added a commit that references this issue on Nov 2, 2026
    f6266d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions