From 6c12a768e87245be83ee7eaa91d02f046b822620 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 7 Aug 2026 13:26:10 -0400 Subject: [PATCH] fix(files_trashbin): report disabled expiration correctly When trashbin_retention_obligation is set to disabled, trashbin:expire incorrectly reports the auto-expiration policy and exits with a failure status. Report that automatic expiration is disabled and exit successfully instead. Signed-off-by: Josh --- apps/files_trashbin/lib/Command/ExpireTrash.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 021bb54e9aa15..1dc7bfc06893d 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -49,9 +49,14 @@ protected function configure(): void { protected function execute(InputInterface $input, OutputInterface $output): int { $minAge = $this->expiration->getMinAgeAsTimestamp(); $maxAge = $this->expiration->getMaxAgeAsTimestamp(); + // Both minAge and maxAge resolve to `false` only when + // Expiration::isEnabled() is false, i.e. the retention policy is "disabled". if ($minAge === false && $maxAge === false) { - $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)'); - return 1; + $output->writeln( + 'Trash bin expiration is disabled (trashbin_retention_obligation is set to "disabled"). ' + . 'No files or folders will be automatically expired by this command.' + ); + return 0; } $userIds = $input->getArgument('user_id');