Skip to content

Commit f111b9c

Browse files
[publication] Fix download prevention by overriding download notification function (#9208)
An error regarding the non-existence of a notification_module with module: publication and operation: download prevented the downloading of files. The notification function was overridden for this module to bypass the LorisException thrown by the non-existence of entries. It appeared by far to be a simpler solution than checking for and adding extra logic when the entries do not exist. Resolves #9133.
1 parent f96d9e4 commit f111b9c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

modules/publication/php/files.class.inc

+17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<?php
2+
3+
// @phan-file-suppress PhanUnusedProtectedMethodParameter
4+
// Suppressed due to false-positive for doDownloadNotification function
5+
// Unused parameter $file required to match parent signature
6+
27
namespace LORIS\publication;
38

49
/**
@@ -49,4 +54,16 @@ class Files extends \LORIS\Http\FilesPassthroughEndpoint
4954
{
5055
return "/files/";
5156
}
57+
58+
/**
59+
* Send a notification for the download.
60+
*
61+
* @param string $file The filename being downloaded
62+
*
63+
* @return void
64+
*/
65+
protected function doDownloadNotification($file)
66+
{
67+
// Not implemented for this module
68+
}
5269
}

0 commit comments

Comments
 (0)