From 573f0ad862fc401b22ec9b9bfa587b9aa6130d5a Mon Sep 17 00:00:00 2001 From: pavel Date: Wed, 18 Sep 2019 18:15:51 +0200 Subject: [PATCH] move find_folder_by_title to before action --- app/controllers/dmsf_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 65455797..d7315d44 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -30,6 +30,9 @@ class DmsfController < ApplicationController before_action :find_parent, :only => [:new, :create] before_action :tree_view, :only => [:delete, :show] before_action :permissions + + # also try to lookup folder by title if this is API call + before_action :find_folder_by_title, :only => [:show], :if => :api_request? accept_api_auth :show, :create, :save, :delete @@ -52,8 +55,6 @@ class DmsfController < ApplicationController end def show - # also try to lookup folder by title if this is API call - find_folder_by_title if [:xml, :json].include? request.format.to_sym get_display_params if (@folder && @folder.deleted?) || (params[:folder_title].present? && !@folder) render_404