Content
View differences
Updated by Christophe Bliard 11 months ago
### Steps to reproduce
Detected through AppSignal unknown (AppSignal)
1. Ensure you can enter start and end time when logging time
1. Administration / Time and Costs / Defaults, check "Allow start and finish times"
2. From my time tracking, in list view, open log time modal by creating a new entry
3. Fill the start time. **Do not fill "End time" or "hours" fields.**
4. Pick any work package
### What is the buggy behavior?
Internal Server error
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/725239/content"> uncaught exception
### What is the expected behavior?
No application error (HTTP 500)
###
### **Logs**
* AppSignal links:
* [https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1038](https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1038)
* [https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1039](https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1039)
#### Backtrace 1
```text
undefined method 'hours' for nil
modules/costs/app/models/time_entry.rb:171 TimeEntry#end_timestamp
modules/costs/app/components/time_entries/days_and_hours_form.rb:90 TimeEntries::DaysAndHoursForm#end_time_in_local_time
modules/costs/app/components/time_entries/days_and_hours_form.rb:63 block (2 levels) in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/days_and_hours_form.rb:47 block in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:36 block (4 levels) in TimeEntries::TimeEntryFormComponent#call
app/components/op_primer/component_helpers.rb:32 OpPrimer::ComponentHelpers#flex_layout
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:32 block (2 levels) in TimeEntries::TimeEntryFormComponent#call
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:31 block in TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:109 TimeEntries::TimeEntryFormComponent#component_wrapper
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:30 TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:54 TimeEntries::TimeEntryFormComponent#render_as_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:59 OpTurbo::ComponentStream#modify_via_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:50 OpTurbo::ComponentStream#replace_via_turbo_stream
modules/costs/app/controllers/time_entries_controller.rb:78 TimeEntriesController#refresh_form
```
#### Backtrace 2
```text
undefined method 'hours' for nil
modules/costs/app/models/time_entry.rb:171 TimeEntry#end_timestamp
modules/costs/app/components/time_entries/days_and_hours_form.rb:90 TimeEntries::DaysAndHoursForm#end_time_in_local_time
modules/costs/app/components/time_entries/days_and_hours_form.rb:63 block (2 levels) in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/days_and_hours_form.rb:47 block in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:36 block (4 levels) in TimeEntries::TimeEntryFormComponent#call
app/components/op_primer/component_helpers.rb:32 OpPrimer::ComponentHelpers#flex_layout
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:32 block (2 levels) in TimeEntries::TimeEntryFormComponent#call
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:31 block in TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:105 TimeEntries::TimeEntryFormComponent#component_wrapper
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:30 TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:52 TimeEntries::TimeEntryFormComponent#render_as_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:59 OpTurbo::ComponentStream#modify_via_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:46 OpTurbo::ComponentStream#update_via_turbo_stream
modules/costs/app/controllers/time_entries_controller.rb:96 TimeEntriesController#create
```
Detected through AppSignal
1. Ensure you can enter start and end time when logging time
1. Administration / Time and Costs / Defaults, check "Allow start and finish times"
2. From my time tracking, in list view, open log time modal by creating a new entry
3. Fill the start time. **Do not fill "End time" or "hours" fields.**
4. Pick any work package
### What is the buggy behavior?
Internal Server error
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/725239/content">
### What is the expected behavior?
No application error (HTTP 500)
###
### **Logs**
* AppSignal links:
* [https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1038](https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1038)
* [https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1039](https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1039)
#### Backtrace 1
```text
undefined method 'hours' for nil
modules/costs/app/models/time_entry.rb:171 TimeEntry#end_timestamp
modules/costs/app/components/time_entries/days_and_hours_form.rb:90 TimeEntries::DaysAndHoursForm#end_time_in_local_time
modules/costs/app/components/time_entries/days_and_hours_form.rb:63 block (2 levels) in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/days_and_hours_form.rb:47 block in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:36 block (4 levels) in TimeEntries::TimeEntryFormComponent#call
app/components/op_primer/component_helpers.rb:32 OpPrimer::ComponentHelpers#flex_layout
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:32 block (2 levels) in TimeEntries::TimeEntryFormComponent#call
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:31 block in TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:109 TimeEntries::TimeEntryFormComponent#component_wrapper
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:30 TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:54 TimeEntries::TimeEntryFormComponent#render_as_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:59 OpTurbo::ComponentStream#modify_via_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:50 OpTurbo::ComponentStream#replace_via_turbo_stream
modules/costs/app/controllers/time_entries_controller.rb:78 TimeEntriesController#refresh_form
```
#### Backtrace 2
```text
undefined method 'hours' for nil
modules/costs/app/models/time_entry.rb:171 TimeEntry#end_timestamp
modules/costs/app/components/time_entries/days_and_hours_form.rb:90 TimeEntries::DaysAndHoursForm#end_time_in_local_time
modules/costs/app/components/time_entries/days_and_hours_form.rb:63 block (2 levels) in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/days_and_hours_form.rb:47 block in <class:DaysAndHoursForm>
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:36 block (4 levels) in TimeEntries::TimeEntryFormComponent#call
app/components/op_primer/component_helpers.rb:32 OpPrimer::ComponentHelpers#flex_layout
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:32 block (2 levels) in TimeEntries::TimeEntryFormComponent#call
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:31 block in TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:105 TimeEntries::TimeEntryFormComponent#component_wrapper
modules/costs/app/components/time_entries/time_entry_form_component.html.erb:30 TimeEntries::TimeEntryFormComponent#call
app/components/concerns/op_turbo/streamable.rb:52 TimeEntries::TimeEntryFormComponent#render_as_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:59 OpTurbo::ComponentStream#modify_via_turbo_stream
app/controllers/concerns/op_turbo/component_stream.rb:46 OpTurbo::ComponentStream#update_via_turbo_stream
modules/costs/app/controllers/time_entries_controller.rb:96 TimeEntriesController#create
```