Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

only pass start_time param for time entry when enabled

Klaus Zandersc9365f00a335
diff --git a/modules/costs/lib/costs/patches/permitted_params_patch.rb b/modules/costs/lib/costs/patches/permitted_params_patch.rb
index af4c1bcdfcc..c3d4d269c68 100644
--- a/modules/costs/lib/costs/patches/permitted_params_patch.rb
+++ b/modules/costs/lib/costs/patches/permitted_params_patch.rb
@@ -66,13 +66,17 @@ module Costs::Patches::PermittedParamsPatch
end
def time_entries
+ additional_fields = []
+
+ additional_fields << :start_time if TimeEntry.can_track_start_and_end_time?
+
params
.require(:time_entry)
.permit(
+ *additional_fields,
:hours,
:comments,
:spent_on,
- :start_time,
:work_package_id,
:activity_id,
:project_id,