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

Render contract errors for wiki

Oliver Günther992ef042ef7f
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index b003b9d9be5..a9b3c37ac8f 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -117,6 +117,7 @@ class WikiController < ApplicationController
flash[:notice] = I18n.t(:notice_successful_create)
redirect_to_show
else
+ @errors = call.errors
render action: 'new'
end
end
@@ -180,6 +181,7 @@ class WikiController < ApplicationController
flash[:notice] = I18n.t(:notice_successful_update)
redirect_to_show
else
+ @errors = call.errors
render action: 'edit'
end
rescue ActiveRecord::StaleObjectError
diff --git a/app/views/wiki/_page_form.html.erb b/app/views/wiki/_page_form.html.erb
index 41b39cd47b6..d5f8c8c369d 100644
--- a/app/views/wiki/_page_form.html.erb
+++ b/app/views/wiki/_page_form.html.erb
@@ -1,4 +1,4 @@
-<%= error_messages_for 'page' %>
+<%= error_messages_for_contract @page, @errors %>
<% resource = ::API::V3::WikiPages::WikiPageRepresenter.new(@page, current_user: current_user, embed_links: true) %>