Skip to content

Commit 8736890

Browse files
authored
Merge pull request #476 from catalyst/issue471
iassue #471: do not throw exception on trash dir related methods
2 parents 8a39023 + 187fcca commit 8736890

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

classes/local/store/object_file_system.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,8 @@ public function cron() {
10091009
* @return string The full path to the trash directory
10101010
*/
10111011
protected function get_trash_fulldir_from_hash($contenthash) {
1012+
// Nothing should be asking objectstorage for it's trashdir path - it doesn't exist.
1013+
// However let's throw an exception unless something else comes up that suggests we need to change it.
10121014
throw new \coding_exception('Objectfs does not implement a trashdir.');
10131015
}
10141016

@@ -1019,6 +1021,9 @@ protected function get_trash_fulldir_from_hash($contenthash) {
10191021
* @return string The full path to the trash file
10201022
*/
10211023
protected function get_trash_fullpath_from_hash($contenthash) {
1022-
throw new \coding_exception('Objectfs does not implement a trashdir.');
1024+
// Method get_trash_fullpath_from_hash called by core filelib functions,
1025+
// and we can't easily change those across stables. So add debugging here.
1026+
debugging('Objectfs does not implement a trashdir.');
1027+
return '';
10231028
}
10241029
}

0 commit comments

Comments
 (0)