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

[#49116] Internal error occurs when invalid project is set to template

Oliver Günther8a68a67b2dbb
diff --git a/app/controllers/projects/templated_controller.rb b/app/controllers/projects/templated_controller.rb
index 8d1ccdc6d7a..514533f6926 100644
--- a/app/controllers/projects/templated_controller.rb
+++ b/app/controllers/projects/templated_controller.rb
@@ -48,10 +48,15 @@ class Projects::TemplatedController < ApplicationController
if service_call.success?
flash[:notice] = t(:notice_successful_update)
- redirect_to project_settings_general_path(@project)
else
- @errors = service_call.errors
- render template: 'projects/settings/general'
+ messages = [
+ t('activerecord.errors.template.header', model: Project.model_name.human, count: service_call.errors.count),
+ service_call.message
+ ]
+
+ flash[:error] = messages.join(". ")
end
+
+ redirect_to project_settings_general_path(@project)
end
end