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
[#64620] fix error flash
Eric Schubert580b213b4a6f
diff --git a/app/controllers/work_package_types/projects_tab_controller.rb b/app/controllers/work_package_types/projects_tab_controller.rbindex 37be196a2f7..510badf78e6 100644--- a/app/controllers/work_package_types/projects_tab_controller.rb+++ b/app/controllers/work_package_types/projects_tab_controller.rb@@ -23,7 +23,7 @@## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.## See COPYRIGHT and LICENSE files for more details.#++@@ -34,14 +34,13 @@ module WorkPackageTypesbefore_action :require_adminbefore_action :find_type+ before_action :load_projects, only: :editcurrent_menu_item [:edit] do:typesend- def edit- @projects = Project.all- end+ def edit; enddef updateresult = UpdateService.new(user: current_user, model: @type, contract_class: UpdateProjectsContract)@@ -50,12 +49,22 @@ module WorkPackageTypesif result.success?redirect_to edit_type_projects_path(type_id: @type.id), notice: I18n.t(:notice_successful_update)else+ flash_error(result)+ load_projectsrender :edit, status: :unprocessable_entityendendprivate+ def flash_error(result)+ flash.now[:error] = result.errors.messages_for(:project_ids).to_sentence+ end++ def load_projects+ @projects = Project.all+ end+def find_type@type = ::Type.find(params[:type_id])end