Closed mihaisolomon closed 1 year ago
Added a table instead of a view for the time logged
Added a table instead of a view for the time logged
That looks better, but I think the Ticket column is not needed, because this table will be visible inside a Ticket view, so all the rows are linked to the shown ticket.
@mihaisolomon yep the first error is resolved, but I got another like I have said in the issue #29
https://flareapp.io/share/Bm0BJyW7
I think the activity is null, and it need to be checked with a condition like below:
foreach ($collection as $item) {
if ($item->activity) { // <- HERE
$datasets['sets'][] = $item->value;
$datasets['labels'][] = $item->activity->name;
} // <- HERE
}
Or better, because I logged my time without linking it to any activity,
foreach ($collection as $item) {
$datasets['sets'][] = $item->value;
$datasets['labels'][] = $item->activity?->name ?? __('No activity');
}
Here is the dd
of my collection:
@heloufir Take a look over this. That error should be gone.