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

[31643] Don't try to render attachments on meeting content journal

Oliver Günther6b0bc944ca40
diff --git a/modules/meeting/app/controllers/meeting_contents_controller.rb b/modules/meeting/app/controllers/meeting_contents_controller.rb
index dc9cd99ff2d..c565558ba1d 100644
--- a/modules/meeting/app/controllers/meeting_contents_controller.rb
+++ b/modules/meeting/app/controllers/meeting_contents_controller.rb
@@ -42,7 +42,9 @@ class MeetingContentsController < ApplicationController
tab: @content_type.sub(/^meeting_/, '')
return
end
+
# go to an old version if a version id is given
+ @journaled_version = true
@content = @content.at_version params[:id] unless params[:id].blank?
render 'meeting_contents/show'
end
diff --git a/modules/meeting/app/views/meeting_contents/_show.html.erb b/modules/meeting/app/views/meeting_contents/_show.html.erb
index 48eacedcfd4..103fc3c1405 100644
--- a/modules/meeting/app/views/meeting_contents/_show.html.erb
+++ b/modules/meeting/app/views/meeting_contents/_show.html.erb
@@ -54,7 +54,10 @@ See doc/COPYRIGHT.md for more details.
<% end -%>
</div>
-<% resource = ::API::V3::MeetingContents::MeetingContentRepresenter.new(content, current_user: current_user, embed_links: true) %>
-<%= list_attachments(resource) %>
+<%# We cannot render attachments for journaled content %>
+<% unless local_assigns[:journaled_version] %>
+ <% resource = ::API::V3::MeetingContents::MeetingContentRepresenter.new(content, current_user: current_user, embed_links: true) %>
+ <%= list_attachments(resource) %>
+<% end %>
<%= render :partial => 'shared/meeting_header' %>
diff --git a/modules/meeting/app/views/meeting_contents/show.html.erb b/modules/meeting/app/views/meeting_contents/show.html.erb
index 4d7a311cf7d..8d257687707 100644
--- a/modules/meeting/app/views/meeting_contents/show.html.erb
+++ b/modules/meeting/app/views/meeting_contents/show.html.erb
@@ -19,4 +19,10 @@ See doc/COPYRIGHT.md for more details.
++#%>
-<%= render(:partial => "meeting_contents/show", :locals => {:content => @content, :content_type => @content_type, :title => "#{l(:"label_#{@content_type}")}: #{link_to @meeting, @meeting}"}) %>
+<%= render partial: "meeting_contents/show",
+ locals: {
+ content: @content,
+ journaled_version: @journaled_version,
+ content_type: @content_type,
+ title: "#{l(:"label_#{@content_type}")}: #{link_to @meeting, @meeting}"
+ } %>