Closed (fixed)
Project:
Labor time tracker
Version:
1.0.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 Jul 2026 at 03:53 UTC
Updated:
16 Jul 2026 at 11:12 UTC
Jump to comment: Most recent
The yearly report page accepts a user query parameter. If the parameter points to a user ID that does not exist, the controller stores NULL in the users list and later calls id() on NULL.
Error: Call to a member function id() on null in Drupal\labor_time_tracker\Controller\TimeLogReportController->report() (line 89 of /var/www/html/lib/web/modules/contrib/labor_time_tracker/src/Controller/TimeLogReportController.php).
1. Install and enable labor_time_tracker.
2. Log in as a user with the "view labor times" permission.
3. Visit: /admin/config/labor-time/log-report?user=999999
Use any numeric user ID that does not exist on the site.
Validate the loaded account before adding it to the $users array. For example:
- If a user filter is present and no account is loaded, show an empty report or a warning message.
- Filter NULL values before iterating.
- Consider validating the filter form input before redirecting/submitting.
Comments
Comment #3
tiagozComment #5
dkmishra commentedHi @tiagoz,
Thanks for fixing this issue.
I noticed that I wasn't granted issue credit. Since I originally reported the issue and proposed the resolution, would you mind adding issue credit for my contribution if you feel it's appropriate?
Thanks!
Comment #6
tiagozOf course @dkmishra ! Thanks for finding the issue.
Comment #7
tiagoz