From b3fc36cf3fcbe4035743e4beca4b572224f45d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 17 May 2022 13:53:58 +0200 Subject: [PATCH] Hook Request #1355 --- app/controllers/dmsf_files_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb index e818d5ee..95c87b0c 100644 --- a/app/controllers/dmsf_files_controller.rb +++ b/app/controllers/dmsf_files_controller.rb @@ -64,9 +64,8 @@ class DmsfFilesController < ApplicationController access.action = DmsfFileRevisionAccess::DownloadAction access.save! # Allow a preview of the file by an external plugin - result = { processed: false } - call_hook(:dmsf_files_controller_before_view, { file: @revision.disk_file, result: result }) - return if result[:processed] + results = call_hook(:dmsf_files_controller_before_view, { file: @revision.disk_file }) + return if results.first == true member = Member.find_by(user_id: User.current.id, project_id: @file.project.id) # IE has got a tendency to cache files expires_in 0.year, 'must-revalidate' => true