Skip to content

Commit 722f472

Browse files
authored
Merge pull request #63040 from nextcloud/jtr/fix-trashbin-occ-expire-output-when-disabled
fix(files_trashbin): misleading trashbin:expire output when expiration is disabled
2 parents e6833d4 + 6c12a76 commit 722f472

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/files_trashbin/lib/Command/ExpireTrash.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ protected function configure(): void {
4949
protected function execute(InputInterface $input, OutputInterface $output): int {
5050
$minAge = $this->expiration->getMinAgeAsTimestamp();
5151
$maxAge = $this->expiration->getMaxAgeAsTimestamp();
52+
// Both minAge and maxAge resolve to `false` only when
53+
// Expiration::isEnabled() is false, i.e. the retention policy is "disabled".
5254
if ($minAge === false && $maxAge === false) {
53-
$output->writeln('Auto expiration is configured - keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed)');
54-
return 1;
55+
$output->writeln(
56+
'Trash bin expiration is disabled (trashbin_retention_obligation is set to "disabled"). '
57+
. 'No files or folders will be automatically expired by this command.'
58+
);
59+
return 0;
5560
}
5661

5762
$userIds = $input->getArgument('user_id');

0 commit comments

Comments
 (0)