KatjaGlassConsulting / ApprovalBundle

A Kimai Plugin to manage weekly approval workflow
MIT License
11 stars 14 forks source link

Opening approvals for active timesheets creates an error #5

Closed mediatecnet closed 2 years ago

mediatecnet commented 2 years ago

Hi there,

maybe I am doing something wrong but whenever I open the approval view on a user which has an active timesheet an error this displayed. Can you maybe help me?

The error message is the following:

[2022-09-15 10:00:15] request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function format() on null" at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php line 161 {"exception":"[object] (Error(code: 0): Call to a member function format() on null at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php:161)"} []
[2022-09-15 10:00:15] php.CRITICAL: Uncaught Error: Call to a member function format() on null {"exception":"[object] (Error(code: 0): Call to a member function format() on null at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php:161)"} []
[2022-09-15 10:00:15] php.INFO: Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero {"exception":"[object] (ErrorException(code: 0): Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php:156)"} []
[2022-09-15 10:00:15] request.INFO: Matched route "approval_bundle_report". {"route":"approval_bundle_report","route_parameters":{"_route":"approval_bundle_report","_controller":"KimaiPlugin\\ApprovalBundle\\Controller\\WeekReportController::weekByUser","_locale":"de"},"request_uri":"https://.../de/approval-report/week_by_user?date=2022-09-12&user=49","method":"GET"} []

Thank you for any kind of help :)

Kind regards, Tim

KatjaGlassConsulting commented 2 years ago

Hi Tim,

as described in Issues - https://github.com/KatjaGlassConsulting/ApprovalBundle#issues - the ApprovalBundle does not support different time zones or different settings of "start week of approval" between users/teamleads/admins. I would expect you have one of these situation. If not I would need additional details.

Nevertheless, that "format" source part will be updated to not through an error.

KatjaGlassConsulting commented 2 years ago

Please try with the newest version (0.9.3) - but when you have different time zones / start of the week day seetings, there will still be quite some issues.

mediatecnet commented 2 years ago

Hi,

first of all thank you for the response and the time spend on this! We technically have different time zones set but there is no difference between them (Berlin/Warsaw), I don't know if that rules something out.

But your update seemed to have at least fixed the exception :) I'll keep an eye out if something like this will happen again but for know I cannot detect anything!

Again thank you so much, Tim

KatjaGlassConsulting commented 2 years ago

Hi Tim, good to hear it's solved. The timezone differences cause only issues when someone uses a time e.g. on Monday, but when another person looks into that time on his/her timezone it is on Sunday.