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

Fix global-scoped MeetingsController actions

Alexander Brandon Coles96308af51214
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb
index c635696abd8..9eb1a8817b4 100644
--- a/modules/meeting/app/controllers/meetings_controller.rb
+++ b/modules/meeting/app/controllers/meetings_controller.rb
@@ -33,6 +33,7 @@ class MeetingsController < ApplicationController
before_action :determine_author, only: %i[history]
before_action :build_meeting, only: %i[new new_dialog]
before_action :find_meeting, except: %i[index new create new_dialog]
+ before_action :set_project, only: %i[copy history update update_participants]
before_action :set_activity, only: %i[history]
before_action :find_copy_from_meeting, only: %i[create]
before_action :convert_params, only: %i[create update update_participants]
@@ -79,8 +80,9 @@ class MeetingsController < ApplicationController
else
render(Meetings::ShowComponent.new(meeting: @meeting, project: @project), layout: true)
end
- elsif @meeting.agenda.present? && @meeting.agenda.locked?
- params[:tab] ||= "minutes"
+ else
+ @project = @meeting.project
+ params[:tab] ||= "minutes" if @meeting.agenda.present? && @meeting.agenda.locked?
end
end
end
@@ -211,6 +213,7 @@ class MeetingsController < ApplicationController
render turbo_stream: @turbo_streams
end
format.html do
+ @project = @meeting.project
render :edit
end
end
@@ -393,11 +396,14 @@ class MeetingsController < ApplicationController
@meeting = Meeting
.includes([:project, :author, { participants: :user }, :agenda, :minutes])
.find(params[:id])
- @project = @meeting.project
rescue ActiveRecord::RecordNotFound
render_404
end
+ def set_project
+ @project = @meeting.project
+ end
+
def convert_params # rubocop:disable Metrics/AbcSize
# We do some preprocessing of `meeting_params` that we will store in this
# instance variable.
diff --git a/modules/meeting/app/views/meetings/show.html.erb b/modules/meeting/app/views/meetings/show.html.erb
index ecb297e3b64..f142534224f 100644
--- a/modules/meeting/app/views/meetings/show.html.erb
+++ b/modules/meeting/app/views/meetings/show.html.erb
@@ -82,7 +82,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if authorize_for(:meetings, :destroy) %>
<li>
<%= link_to(t(:button_delete),
- meeting_path(@meeting),
+ polymorphic_path([@project, @meeting]),
class: 'icon-context icon-delete',
method: :delete,
data: { confirm: t(:text_are_you_sure) }) %>