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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
add permitted params for time entries
Klaus Zandersbb3026b30496
diff --git a/modules/costs/app/controllers/projects/time_entries_controller.rb b/modules/costs/app/controllers/projects/time_entries_controller.rbindex 8eff458e2e2..ef84455136e 100644--- a/modules/costs/app/controllers/projects/time_entries_controller.rb+++ b/modules/costs/app/controllers/projects/time_entries_controller.rb@@ -45,8 +45,16 @@ module Projectsendend- def create; end+ def create+ puts "*" * 100+ pp(permitted_params.time_entries)+ puts "*" * 100+ end- def update; end+ def update+ puts "*" * 100+ pp(permitted_params.time_entries)+ puts "*" * 100+ endendenddiff --git a/modules/costs/lib/costs/patches/permitted_params_patch.rb b/modules/costs/lib/costs/patches/permitted_params_patch.rbindex 783e45c4396..8570d9eda61 100644--- a/modules/costs/lib/costs/patches/permitted_params_patch.rb+++ b/modules/costs/lib/costs/patches/permitted_params_patch.rb@@ -62,5 +62,22 @@ module Costs::Patches::PermittedParamsPatchparams.require(:user).permit(new_rate_attributes: %i[valid_from rate],existing_rate_attributes: %i[valid_from rate])end++ def time_entries+ params+ .require(:time_entry)+ .permit(+ :hours,+ :comments,+ :spent_on,+ :start_time,+ :work_package_id,+ :activity,+ :project_id,+ :issue_id,+ :user_id+ )+ .merge(custom_field_values(:time_entry))+ endendend