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
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.rbindex 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 < ApplicationControllerbefore_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 < ApplicationControllerelserender(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?endendend@@ -211,6 +213,7 @@ class MeetingsController < ApplicationControllerrender turbo_stream: @turbo_streamsendformat.html do+ @project = @meeting.projectrender :editendend@@ -393,11 +396,14 @@ class MeetingsController < ApplicationController@meeting = Meeting.includes([:project, :author, { participants: :user }, :agenda, :minutes]).find(params[:id])- @project = @meeting.projectrescue ActiveRecord::RecordNotFoundrender_404end+ 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.erbindex 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) }) %>